SIMPLE UNIX COMMANDS 1) File and Directory Manipulation abut :put two files side by side cat f1 :PRINT the contents of the file "f1" on the screen cd d1 :CHANGE DIRECTORY to "d1" (make "d1" your CURRENT DIRECTORY) cp f1 f2 :COPY file "f1" to file "f2" diff f1 f2 :PRINT the DIFFERENCES between files "f1" and "f2" file fname :describe what kind of file FNAME is grep pat f1 :PRINT all lines in f1 which have the pattern "pat" on them. head -n f1 :PRINT the first n lines of "f1" on the screen ls :LIST contents of the current working directory mkdir d1 :CREATE the directory d1 more f1 :PRINT the contents of file "f1" a screenful at a time mv f1 f2 :MOVE file "f1" to file "f2" (i.e. RENAME file "f1" "f2") pwd :print the CURRENT DIRECTORY rm f1 f2 f3 :REMOVE files f1, f2, and f3. rmdir d1 :REMOVE the directory d1 tail -n f1 :PRINT the last n lines of "f1" on the screen vi f1 :EDIT file "f1" (CREATES "f1" if it does not exist) 2) Compiling programs f77 -o p1 p1.f :compile the FORTRAN file "p1.f" and put the output in "p1" cc -o p1 p1.c :compile the C file "p1.c" and put the output in "p1" cerrors :interpret COMPILER ERRORS and put them in the source file make :a program which makes it easy to COMPILE programs p1 :RUN the program p1 which you just compiled via f77 or cc. 3) Keeping Track of Disk Usage df :tell how much disk space is left on the computer du :tell how much disk space is being used by the current working directory du dirname :tell how much disk space is being used by the directory "dirname" 4) Keeping Track of Jobs; Job Control ps :PRINT all the PROCESSES you have running jobs :PRINT all the JOBS you have running :suspend the current job bg :put the most recently suspended job in background command & :the & means to run the job in background and frees the terminal so you can go on to something else while the job is running. fg :bring a job into the foreground %2 :bring job number 2 to foreground (2 is the number next to the job when you use the "jobs" command. kill %3 :kill job number 2 kill 2365 :kill process number 2356. (2356 is the number next to the process when you use the "ps" command. Communicating with Other Users mail ralph :send mail to the user whose login name is ralph write ralph :write a message to the user whose login name is ralph Logging on and Off login :This is the login prompt. First type your user name, then your password. logout :log out of the system. passwd :change your password Printing Files to the Line Printer lp filename :send the file "filename" to the line printer print filename :send the file "filename" to the line printer with a header cancel :cancel a line printer job Getting Documentation apropos word :PRINT an INDEX of all programs which pertain to "word" man -k word :same as apropos man progname :PRINT the MANUAL ENTRY for the program named "progname" Clearing the Screen clear :clear the terminal screen but not the graphics cleargp :clear the screen and graphics Data Processing avg :AVERAGE a column of numbers in a file (print AVERAGE, STANDARD DEVIATION and SUM burg :REAL BURG AUTOREGRESSION spectrum analysis program cburg :COMPLEX BURG AUTOREGRESSION spectrum analysis program clear_ap :clear the ARRAY PROCESSOR status bits cspect :COMPLEX FAST FOURIER TRANSFORM spectrum analysis program. dm :do simple ARITHMETIC MANIPULATION on COLUMNS in an input file least :do a LINEAR LEAST SQUARES FIT of input data pfit :POLYNOMIAL LEAST SQUARES FIT program pwrspc :REAL FAST FOIURIER TRANSFORM spectrum analysis program. readfil :READ a file of DIGITIZED or TSI data reduce :do DATA REDUCTION on ELECTROCARDIOGRAM data Data Collection ldain :input LASER ANEMOMETER data through the parallel interface digit :DIGITIZE analogue data readfil :READ a file of DIGITIZED or TSI data Machine to Machine File Transfer kermit :KERMIT intra-machine FILE TRANSFER program Making x-y Plots tekplot :PLOTTING FILTER for TEKTRONIX terminals crtplot :low resolution PLOTTING FILTER for any crt screen csgraph :program for plotting data (taken from a file) Miscellaneous remind :print daily reminder memos