Date post: | 26-Dec-2015 |
Category: |
Documents |
Upload: | samantha-scott |
View: | 219 times |
Download: | 0 times |
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
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
Commands for files• To get the file
typeo file filename
• To read a fileo less filenameo less is better than
more