Page 1
VI, March 2005
Introduction to Unix http://linux.oreilly.com/ VI, March 2005 Page - - PowerPoint PPT Presentation
Unix tutorial Introduction to Unix http://linux.oreilly.com/ VI, March 2005 Page 1 Unix tutorial Outline Basic background in Unix structure Directories and files I (listing, navigation, filenames) Directories and files II
Page 1
VI, March 2005
Page 2
VI, March 2005
Page 3
VI, March 2005
Page 4
VI, March 2005
Page 5
VI, March 2005
Page 6
VI, March 2005
/ /usr /home phil john local bin lib emacs X11
Page 7
VI, March 2005
(/home/john)
/ /usr /home phil john local bin lib file.txt dir_1 file2.txt file3.txt
Page 8
VI, March 2005
copy orig.file copy.file (pathname may be required)
mv file1 file2
rm -i file2 (-i : interactive)
find . -name lostfile -print
/ /usr /home phil john local bin lib file.txt dir_1 file2.txt file3.txt
Page 9
VI, March 2005
less file.txt
head -20 file.txt diplays the first 20 lines from the file "file.txt"
tail -20 file.txt diplays the last 20 lines from the file "file.txt"
Page 10
VI, March 2005
diff file1 file2
grep word file.txt
grep "following words" file.txt displays all lines containing "following words" grep -c word file.txt displays the number of lines containing the string grep -e "one" -e "two" -e "three" file.txt displays all lines containing "one" or
grep -v "word"
Page 11
VI, March 2005
Important: Unix & all Unix flavors: \n Mac OS : \r Windows:\r\n
Page 12
VI, March 2005
cat file1 file2 > file3
cat file4 file5 >> file3
grep word file.txt | wc
Page 13
VI, March 2005
Emacs is the extensible, customizable, self-documenting real-time display editor. (http://www.gnu.org/software/emacs/emacs.html)
A Unix text editor
Page 14
VI, March 2005
sib-dea: ~> ls -l total 4 drwxr-xr-x 2 student01 dea 512 Feb 16 17:30 cgi-bin
drwxr-xr-x 2 student01 dea 512 Feb 16 17:30 public_html
d indicates a directory 9 letters code indicating right access Owner of the file Group owning the file Size Date of creation Name
Page 15
VI, March 2005
group
r w x r w x r w x
Page 16
VI, March 2005
group
r w x r w x r w x
u USER g GROUP
r READ w WRITE x EXECUTE
+ ADD PERMISSION a ALL chmod a+x file.pl chmod g+w file.pl
Page 17
VI, March 2005
kill %1 (kills the job number 1)
Page 18
VI, March 2005
tar -cvf tarball.tar subdir/* tar -xvf tarball.tar
Page 19
VI, March 2005
man grep (Lists help information on the "grep" command.)
man -k route (This command displays a one-line summary from each manual page matching the keyword "traceroute" Look through the matches for a likely candidate manual page.)