150 likes | 242 Views
ATS Programming Short Course I. INTRODUCTORY CONCEPTS. Essential Unix Commands. …the second half. Tuesday, Feb 3 rd , 2009. df -. Disk space Free. Shows amount of free disk space. Examples:. (1)>. (2)>. (3)>. df –k /dev/ devicename. Command example 2. Command example 3.
E N D
ATS Programming Short Course I INTRODUCTORY CONCEPTS Essential Unix Commands …the second half Tuesday, Feb 3rd, 2009
df - Disk space Free Shows 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 - 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.
ps - ProcesS Show 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 a command Terminates 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 - Tape ARchive Bundle (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 - Gnu(?) ZIP Zip 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 - Gnu(?) UNZIP Unzip a gzipped file. Examples: (1)> (2)> (3)> gunzipfilename.tar.gz Command example 2 Command example 3 Uncompresses the above file. Leaves filename.tar Command example 2 description. Command example 3 description.
man - MANuel page Show 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 - Line Printer Queue Display 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 - Line PRinter Send a job (file) to be printed. Examples: (1)> (2)> (3)> lpr –P printerNamefileName Command example 2 Command example 3 Send fileName to be printed on the printer PrinterName. Command example 2 description. Command example 3 description.
lprm - Line Printer ReMove Remove a job that has been sent to a printer. Examples: (1)> (2)> (3)> lprm –P printerNamejobID 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 to output Display 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 files Search 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 - ? 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.