ats programming short course i introductory concepts tuesday, feb 3 rd, 2009 essential unix commands...
DESCRIPTION
du - Disk Usage Show how much disk space is being used. Examples: (1)> (2)> (3)> du –k directoryName Command example 2 Command example 3 Display the amount of space used by directoryName in kilobytes. Command example 2 description. Command example 3 description.TRANSCRIPT
ATS Programming Short ATS Programming Short Course ICourse I
INTRODUCTORY CONCEPTS
Tuesday, Feb 3rd, 2009
Essential Unix Commands
…the second half
df -df -Disk space FreeShows amount of free disk space.
Examples:(1)>
(2)>
(3)>
df –k /dev/devicename
Command example 2
Command example 3
Report the amount of free space in kilobytes on the specified device.
Command example 2 description.
Command example 3 description.
du -du -Disk UsageShow how much disk space is being used.
Examples:(1)>
(2)>
(3)>
du –k directoryName
Command example 2
Command example 3
Display the amount of space used by directoryName in kilobytes.
Command example 2 description.
Command example 3 description.
ps -ps -ProcesSShow processes.
Examples:(1)>
(2)>
(3)>
ps -ef
Command example 2
Command example 3
List all processes in long format.
Command example 2 description.
Command example 3 description.
kill -kill -KILL a commandTerminates a running job/process.
Examples:(1)>
(2)>
(3)>
kill processID1
kill -9 processID6
Command example 3
Kills the command identified by processID1.
Kills processID6 forcefully. Ie, if processID6 is not responding to the kill signal, the -9 give the kill signal a bit more weight.
Command example 3 description.
tar -tar -Tape ARchiveBundle (tar) files together.
Examples:(1)>
(2)>
(3)>
tar cvf dir1.tar ./dir1
tar rvf filename.tar ./dir3
tar xvf filename.tar
Creates a tar file called dir1.tar with the contents of dir1. verbose.
Appends contents of dir3 in already existing tar file, filename.tar. Verbose.
Extracts contents of filename.tar. The output is structured as it was put in.
gzip -gzip -Gnu(?) ZIPZip a file (compress)
Examples:(1)>
(2)>
(3)>
gzip filename.tar
Command example 2
Command example 3
Compresses filename.tar, resulting in the file filename.tar.gz
Command example 2 description.
Command example 3 description.
gunzip -gunzip -Gnu(?) UNZIPUnzip a gzipped file.
Examples:(1)>
(2)>
(3)>
gunzip filename.tar.gz
Command example 2
Command example 3
Uncompresses the above file. Leaves filename.tar
Command example 2 description.
Command example 3 description.
man -man -MANuel pageShow the manuel page for a command.
Examples:(1)>
(2)>
(3)>
man ls
Command example 2
Command example 3
Display lots of information about the ls command.
Command example 2 description.
Command example 3 description.
lpq -lpq -Line Printer QueueDisplay the items in the printer queue.
Examples:(1)>
(2)>
(3)>
lpq –P printerName
Command example 2
Command example 3
Displays queue information (jobID’s) for printer printerName.
Command example 2 description.
Command example 3 description.
lpr -lpr -Line PRinterSend a job (file) to be printed.
Examples:(1)>
(2)>
(3)>
lpr –P printerName fileName
Command example 2
Command example 3
Send fileName to be printed on the printer PrinterName.
Command example 2 description.
Command example 3 description.
lprm -lprm -Line Printer ReMoveRemove a job that has been sent to a printer.
Examples:(1)>
(2)>
(3)>
lprm –P printerName jobID
Command example 2
Command example 3
Removes the print job identified by jobID from printerName’s queue.
Command example 2 description.
Command example 3 description.
echo -echo -ECHO to outputDisplay to screen.
Examples:(1)>
(2)>
(3)>
echo ${SHELL}
Command example 2
Command example 3
Displays the value of the variable ${SHELL}
Command example 2 description.
Command example 3 description.
find -find -FIND filesSearch for files by filename.
Examples:(1)>
(2)>
(3)>
find . \! –name ‘[A-Z]*’ -print
find /work –name chapter1 -print
Command example 3
Find all files in the current directory that don’t begin with a capital letter.
Find all files under the directory /work that are named chapter1.
Command example 3 description.
grep -grep -? Look for files containing text patterns (Note: text
patterns in the file contents as opposed to filename).
Examples:(1)>
(2)>
(3)>
grep –l ‘^#include’ /usr/include/*
Command example 2
Command example 3
List all files under /usr/include that contain at least one #include directive.
Command example 2 description.
Command example 3 description.