BASIC UNIX/LINUX COMMANDS
File Management
find . -name (file) -print Find the file (file)
cp (name1) (name2) Copy the file (name1) to the file (name2)
mkdir (name) Make a sub-directory (name)
cd (name) Change to the sub-directory (name)
cd .. Change to the directory above
cd Change to your home directory
mv (name1) (name2) Rename the file (name1) to (name2)
rm (name) Remove (delete) the file (name)
ls List files in the working directory
cat (name) Display the file (name) to the screen
more (name) Display the file (name) one screen at a time
pwd Display the current working directory
lpr (name) Send the file (name) to the printer
Editing and Word Processing
pico (name) Edit/create the file (name)
nedit (name) Edit/create the file (name) [recommended editor]
latex (name).tex Invoke the latex word processor
xdvi (name).dvi Preview/review processed latex file
dvips -f (name) > (name).ps Create Postscript file (name).ps of a latex document
gs (name).ps Preview the final Postscript file (name).ps
lpr (name).ps Print the Postscript file (name).ps
Program Compilation and Execution
f90 -o (name).x (name).f90 Compiles F90 code and creates executable (name).x (SGIs)
ifc -o (name).x (name).f90 Compiles F90 code and creates executable (name).x (LINUX PCs)
cc -o (name).x (name).f90 Compiles C code and creates executable (name).x
(name).x Runs the compiled code
(name).x < (inputfile) Runs the compiled code with redirected input
(name).x > (outputfile) Runs the compiled code with redirected output
(name).x < (inputfile) > (outputfile) Runs the compiled code; redirects input and output
Communication
scp (name1) (username)@cedar.math.jmu.edu:/(name2) Secure copy of (name1) from one user to another
mail (username) Mail a message to (username)
Software Packages
matlab MatLab
xmaple Maple
math Mathematica
netscape Netscape internet navigator
pine Email software
Miscellaneous Useful and Nifty Commands
man (command) Information on (command)
passwd Change your password
history List previous commands in numerical order
!135 Re-execute command 135 (following history)
diff (name1) (name2) Compare files (name1) and (name2) line by line
grep ”(pattern)” (file list) Search for (pattern) in listed files
cal 9 2001 Display a calendar for Sept. 2001