21
EMT 2390L Lecture 2 Dr. Reyes

EMT 2390L Lecture 2 Dr. Reyes. Outline What is the Shell Basic commands Linux Filesystem System commands

Embed Size (px)

Citation preview

EMT 2390LLecture 2

Dr. Reyes

Outline• What is the Shell• Basic commands• Linux Filesystem• System commands

What is the Shell?• Shell - a program that takes keyboard commands

and passes them to the operating system to carry out

• Types of Shells:o C-Shell: csh, tcsho Bourne Shell: sh o Bourne Again Shell: bash

• When using a GUI, a terminal emulator is used to interact with the shello KDE uses konsoleo GNOME uses gnome-terminal

Shell Prompt

Session Privileges• Prompt ending with:

o $ - regular user, privileges varieso # - superuser

Command History• Press up-arrow key for previous command• Press down-arrow key for next command• Press left-arrow key to move back in the same

line• Press right-arrow key to move back in the same

line• Limited support for mouse interaction• Some keyboard shortcuts might not work, as they

belong to Windows:o Ctrl-Co Ctrl-V

Commands• Try the following commands:

o date – displays the dateo cal – displays the calendar o df – disk availableo free – memory availableo exit – to exit the system

Filesystem Tree• Linux uses hierarchical

directory structureo Tree-like structureo Root – First directoryo Drives are not separate trees, instead

they are mountedo You can see the files and the parent of

the current directoryo Each user account is given it’s own

home directory

Commands for Directories• pwd - lists the current working directory• ls – lists the files and sub-directories in the

current working directory• cd – change to the specified directory

o cd /usr/bin – changes to dir /usr/bino cd / - changes to root dir

• Special parameterso . (dot) – current directoryo .. (double dot) – parent directoryo - (dash) – changes to the previous working directoryo ~ (tilde) – changes to your home directoryo ~username – changed to home directory of username

Linux Filenames Facts• Filenames that begin with a period character are

hidden. To display them use ls –a• Filenames are case sensitive• In Linux there are no file extensions such as .doc

or .exe• Avoid using spaces and special characters even if

is supported.

Other uses of ls• Try the following options with ls

o ls /usro ls ~ /usro ls – l

• Most commands have options and argumento command –options argumentso options might be a dash and a single character or two dashes followed

by a word

ls Options

ls –l What all that means?

Commands for files• To get the file

typeo file filename

• To read a fileo less filenameo less is better than

more

Some Linux Directories

Some Linux Directories

Some Linux Directories

Some Linux Directories

Some Linux Directories

Some Linux Directories

©1992-2012 by Pearson Education, Inc. All Rights Reserved.

Assignments• Check the class OpenLab site for new Labs

o Lab 0 is mandatory.

• Check Blackboard for new Quizzeso Quiz 0 is mandatory.