Moving, Removing and Creating: PWD Ls
Moving, Removing and Creating: PWD Ls
Printing
I a2ps - pretty print a text file
a2ps highlights keywords, strings, comments and constants have a
different color or font style. If it knows the (programming) language in
which your file is written, it will try to make it look nice on paper.
I $ a2ps file2print default format, 2up, border, headers
I $ a2ps -r --columns=1 -l=132 myfile -P prntrname wide, 132 char width
I $ a2ps file2print -o outfile.ps send output to a file
I $ card file2print -o outfile.ps FIX ME AND POPULATE
I lp - dumb printing
Linux Survival Commands
Finding, Checking
I find - locate a file
I $ find . -name myfile -print
start here, search for ”myfile”
I $ find / -name "*ECE*" -print
start at /, search for files with ”ECE” in them
I $ find /bin -mmin -10 -print
search in /bin for files that changed less than 10 minutes ago
I less - view contents of a text file
I $ less file2read view contents of text file file2read
I head - view first 10 lines of a text file
I $ head -n 20 file2read view first 20 lines of file2read
I tail - view last 10 lines of a text file
I $ tail -n 20 file2read view last 20 lines of file2read
Linux Survival Commands
Finding, Checking (cont.)
I grep - search for a string in a file
I $ grep "literal string" file2examine
search for string ”literal string” in file2examine and print match lines
I $ grep INCLUDE *.c search all .c files for the string INCLUDE
I diff - compare two files and report differences
I $ diff file1 file2 compare two files and report differences
I man - display manual for a command
I $ man command display manual for a command
I whatis - brief description of command
I $ whatis chmod give brief description of chmod command
I history - list previous commands
I $ history give list of previous commands
I cal - print calendar
I $ cal print present month calendar
I $ cal 2013 print year 2013 calendar
I date - print day, date, time, year, timezone
I ps - list process status
I $ ps -ef list all process running on the systemg
I $ ps -u username list all process running owned by username
I $ ps -ef | grep command list all process running ”command”
Linux Survival Commands