160 likes | 271 Views
Lecture 4: Utilities ( ch 3). IT244 - Introduction to Linux / Unix Instructor: Bo Sheng. Outline. Basic utilities ( ch 3) Homework 1. Basic Utilities. Record shell display ( script ) script / exit script ls cat months exit cat typescript. Compress/decompress Files. bzip2
E N D
Lecture 4: Utilities (ch 3) IT244 - Introduction to Linux / Unix Instructor: Bo Sheng
Outline • Basic utilities (ch 3) • Homework 1
Basic Utilities • Record shell display ( script ) • script / exit • script • ls • cat months • exit • cat typescript
Compress/decompress Files • bzip2 • bzip2 –v linux • ls –l (compare the file sizes) • bunzip2 linux.bz2 • ‘-k’ keeps the original file • bzip2 –vklinux • bzcat linux.bz2
Compress/decompress Files • gzip (GNU zip) • gzip, gunzip, zcat • gziplinux • ls -l • zcat linux.gz • gunzip linux.gz
Compress/decompress Files • Try multiple files • gzip days months linux • gunzipdays.gzmonths.gzlinux.gz • bzip2 … • bunzip2 …
Compress/decompress Files • tar is for archiving not compressing • tar –cvf all.tar days months • ls –l (compare file sizes) • tar –tfall.tar(list files) • tar –xvfall.tar(extract files) -c:create, -v:verbose, -f:specify filename
Compress/decompress Files • tar is for archiving not compressing • Compress .tar files using bzip2 and gzip • .tar.gz, .tgz, .tar.bz2, .tbz • tar –cvfall.tar months days linux • gzip –vall.tar http://www.kernel.org/pub/linux/kernel/v2.6/
Compress/decompress Files • Decompresstar.gz files • gunzipall.tar.gz • ls –l • tar –xvf all.tar • gunzip –c all.tar.gz | tar –xvf - • tar –zxvfall.tar.gz
Locating Utilities/Commands • which and whereis • Multiple copies of utilities • which checks search path and display the first result • which tar • which wc • whereischecks standard directories • whereis tar • whereiswc
Locating Utilities/Commands • which and whereis • Built-in utilities • whereis echo • which echo • type echo • type cd
User and System Info • date • date • Format the display • date +‘%A %B %d’ • who ( list users on the system) • who • who am i
User and System Info • finger( list users on the system ) • finger your username • finger it244 • finger sheng • cd /home/your username • echo “***” > .plan • echo “***” > .project • finger your username
User and System Info • w • Comparison table (Pg73)
Summary • Shell record (script / exit) • Compress/Archive files • bzip2, gzip, tar • User/System info • date, which/whereis, locate, type • who, finger, w