Lab 1- Practical Exercise on Getting Started
1.
Logging In
·
UserID
and password – used
to login to any UNIX system
à
passwd – utility for changing your password
2.
Looking Around
·
System
Information
à
date – for for seeing the current date and time
à
uptime – for seeing date / time, number of users and the load on the machine
à
who – for seeing who is on the system and where they came from
à
w – for seeing who is on the system and what they’re doing
·
User
Information
à
whoami, who am i – used to get information on your current login
à
finger{@hostname} {login-name} – for getting
information on a user, yourself or someone else
·
User
Communications
à
write login-name – send one line of a message to other user
à
talk login-name{@hostname} {tty} –
interactive chat with another user
à
mesg
[ y | n ] – turn messages to yourself on or off
à
biff
[ y | n ] – allow notification of incoming e-mail
messages
à
mail –
“old” way to send and read e-mail
à
pine –
“new” method of reading e-mail
·
Help
à
man [ -k ] command – get help (manual pages) on a command
3.
Using the System
·
Directories
à
pwd – shows the directory you’re currently in (present working directory)
à
cd path – change your directory to the one specified
à
cd ~ – changes you back to your “home” directory (default login directory
from /etc/passwd file)
à
cd – acts the same as above
·
Files
à
ls [filename …] – shows (lists) files in
the current directory
à
ls –l – shows files in the current directory including permissions, owner,
group, time, etc.
à
ls -A – show all files in the directory, including “hidden” (dot) files
à
ls -F – show all files in the directory using special characters to identify
file types
à
touch filename – creates a file with nothing in it (0 bytes)
à
cp source-file destination-file – copy a file to a new file (absolute or
relative paths O.K.)
à
mv source-file
destination-file –
rename (move) a file to another file (includes directories)
à
rm filename – deletes (removes) a file (permanently!!!!)
à
cat filename – displays the contents of a file
à
more filename – displays the contents of a file one screen
at a time
à
less filename – displays the contents of a file, allowing
you to scroll up or down in the file
à
head { -#-of-lines } – display the first
lines of a file, default is 10
à
tail { -#-of-lines } – display the last lines
of a file, default is 10
à
grep search-string
filename – search a file for text
(the search-string)
à
sort filename – sort each line of a file in alpha-numeric
order
à
uniq filename – show only unique lines in a file
à
diff file1
file2 – compare file1 with
file2, showing the differences between them
à
compress filename – compact a file to save space (changes a
text file to a binary file…)
à
uncompress filename – un-compact a file back to its original form
and size
à
zcat filename – show the contents of a compressed file
à
wc { -l } filename – calculate the number of lines (word count)
in a file
à
ln { -s } file1
file2 – links original file1
to the new file2
·
Editing
à
vi { filename } – edit a file (visual);
this is the UNIX-guru way!
à
pico {
filename } – edit a file; this is the ‘novice’ way!
4.
Logging Out
·
logout – logs you out of the UNIX system, ending your session: always do
this!!!