Professional Documents
Culture Documents
Introduction To UNIX: Lecture Three: 3.1 Objectives
Introduction To UNIX: Lecture Three: 3.1 Objectives
Introduction to UNIX:
Lecture Three
3.1 Objectives
This lecture covers:
1 of 12 28/10/2019, 11:21 AM
Introduction to UNIX and Linux: Lecture 3 http://www.doc.ic.ac.uk/~wjk/UnixIntro/Lecture...
--- 0
--x 1
-w- 2
-wx 3
r-- 4
r-x 5
rw- 6
rwx 7
2 of 12 28/10/2019, 11:21 AM
Introduction to UNIX and Linux: Lecture 3 http://www.doc.ic.ac.uk/~wjk/UnixIntro/Lecture...
command:
$ chmod ug=rw,o-rw,a-x *.txt
file filename(s)
3 of 12 28/10/2019, 11:21 AM
Introduction to UNIX and Linux: Lecture 3 http://www.doc.ic.ac.uk/~wjk/UnixIntro/Lecture...
headand tail display the first and last few lines in a file
respectively. You can specify the number of lines as an
option, e.g.
4 of 12 28/10/2019, 11:21 AM
Introduction to UNIX and Linux: Lecture 3 http://www.doc.ic.ac.uk/~wjk/UnixIntro/Lecture...
find
5 of 12 28/10/2019, 11:21 AM
Introduction to UNIX and Linux: Lecture 3 http://www.doc.ic.ac.uk/~wjk/UnixIntro/Lecture...
For more information about find and its abilities, use man
find and/or info find.
$ which ls
/bin/ls
locate string
6 of 12 28/10/2019, 11:21 AM
Introduction to UNIX and Linux: Lecture 3 http://www.doc.ic.ac.uk/~wjk/UnixIntro/Lecture...
7 of 12 28/10/2019, 11:21 AM
Introduction to UNIX and Linux: Lecture 3 http://www.doc.ic.ac.uk/~wjk/UnixIntro/Lecture...
The caret `^' and the dollar sign `$' are special
characters that
match the beginning and end of a line respectively. The
dot '.' matches any character. So
8 of 12 28/10/2019, 11:21 AM
Introduction to UNIX and Linux: Lecture 3 http://www.doc.ic.ac.uk/~wjk/UnixIntro/Lecture...
times.
`{N,M}'means the preceding item is matched at least N
times, but not more than M times.
sort filenames
uniq filename
9 of 12 28/10/2019, 11:21 AM
Introduction to UNIX and Linux: Lecture 3 http://www.doc.ic.ac.uk/~wjk/UnixIntro/Lecture...
cpio
This will take all the files in the current directory and
the
directories below and place them in an archive called
archivename.The -depth option controls the order in
10 of 12 28/10/2019, 11:21 AM
Introduction to UNIX and Linux: Lecture 3 http://www.doc.ic.ac.uk/~wjk/UnixIntro/Lecture...
compress, gzip
11 of 12 28/10/2019, 11:21 AM
Introduction to UNIX and Linux: Lecture 3 http://www.doc.ic.ac.uk/~wjk/UnixIntro/Lecture...
mount, umount
$ cat /etc/fstab
/dev/fd0 /mnt/floppy auto rw,user,noauto 0 0
/dev/hdc /mnt/cdrom iso9660 ro,user,noauto 0 0
$ mount /mnt/floppy
$ cd /mnt/floppy
$ ls (etc...)
mtools
12 of 12 28/10/2019, 11:21 AM