Inessential Unix by Rudolph Magyar 5/14/0 ________________ Getting Around ---------------- >man topic Provides complete but often confusing help about the topic "topic". >cd some_directory Changes the working directory to "some_directory". >cd .. Changes the working directory back one step of regression. That is if you are in "/home/superior/inferior", cd .. will take you to "/home/superior". >cd Takes you to your home directory. >mkdir new_directory Makes a directory entitles "new_directory". >rmdir old_directory Gets rid of "old_directory". __________________ Working with files ------------------ >ls -la Lists the files in the current directory. The "a" tells the computer to show system files, and the "l" controls the type of format. >rm file.exe Deletes the file "file.exe". >rm -fr baneful_directory Force deletes files in the directory "baneful_directory" and its subdirectories. "f" is for force, and "r" is for recursive. >mv a.exe b.exe Renames "a.exe" to "b.exe" >cp file duplicate Copies "file" to "duplicate". >cat book.txt | more or >more book.txt Displays the contents of the file "book.txt". A single screen is presented at a time. The space bar advances to the next screen, and "q" quits. >head book.txt and >tail book.txt Shows the first (last) ten liness of "book.txt". >chmod 755 my_file Sets the permissions on the file called "my_file". The first digit is you, the second the local cluster (I think), and the final, the world. 7 means full permision, 5 means read and execute. Use "> ls -la" to check that permissions are set properly... ___________________ Running executables ------------------- >executable.exe & Runs an executable file. The "&" means that the file is run in the back ground. You will continue to be able to enter commands at the prompt while the file is running. ctrl-C Terminates the current process. ctrl-Z Puts the current process into the background >bg Starts running the last "ctrl-Z" process in the background. >fg -4545 Puts process 4545 into the forground. >ps Shows the processes which you are running >kill 111 Termionates the process with the number 111. >kill -9 111 Force terminates the process with the number 111. _____________ Printing ------------- > enscript -2GfTimes-Roman8 -C textfile.txt -opostscriptfile.ps Makes a text file look a little more human. Specifically, uses Times Roman 8 pt font, prints two columns, numbers the lines, adds a verbous header, and saves the file as postscriptfile.ps. > psnup -nup 4 postscript.ps dense postscript.ps Puts four postscript pages onto one! >lpr -Plocal print_me.txt Prints the file called "print_me.txt" on the printer called "local". >lpq -Plocal Shows you which files are lined up for printing on the printer named "local". >lprm 123 Stops the printing jobbed numbered 123. _______________________ Editting features ----------------------- >awk '{print $1, $3-$2}' data.txt > a.txt Repackages data in file "data.txt". Specifically, sends column one and the sum of columns two and three to a file called "a.txt". ` >awk '{print $1, $5}' data.txt | xgraph Sends column one and five to be graphed by xgraph, an easy to use but not too powerful graphing package. >find . -name lostfile -print Search current directory and subdirectories to find "lostfile". It is recommended that you not use find as it uses many system resources. >locate lostfile If root is assiduous and updates the database regularly, then, use this instead of find. It hogs less system resources up. >grep -i cocacola * Finds all files in the current directory which make reference to "cocacola". The $i$ makes the search NOT case sensative. _________________________ Miscellaneous Useful Hints -------------------------- Pushing the TAB key will print the previously entered line at the prompt. For quick, user friendly editting, use PICO. It is recommended that you use GNUPLOT for graphing and EMACS for editting. We have installed the following useful packages: acroread - reader for PDF files secure shell - secure (preferred) remote login Here's an example of how to use this: > ssh kanga -l dft This will log you onto kanga and handle all the xhost-setenv business. > scp my_local.file dft@kanga:my_remote.file This copies "my_local.file" to the dft account on kanga, and it gives the file the new name "my_remote.file". This is much like ftp. > scp dft@kanga:my_remote.file . This puts "my_remote.file" on kanga to the current local directory. gnuplot - plotting program xmgr - another plotting program xfig - graphics tool xgraph - yet another graphing program enscript - utility which converts txt files to nice postscript formats. >enscript -2GfCourier7 text.txt -opostscript.ps This converts text.txt to postscript using a two column format with Courier7 font. Notice that there is no space between "o" and "postscript.ps" xosview - CPU and system workload monitor