Science and Computers -- PHY307/607

Simple Unix Commands


ls
Typing ls at the unix prompt lists the files in the current directory.
mv
The mv command can be used for renaming files eg mv olfilename newfilename
cd
To change directory (folder) type cd dirname. To go to your top level directory type cd by iself. Typing cd .. takes you up one level in your directory structure i.e it takes you to the parent directory of the one you are currently in.
rm
To delete a file type rm filename
cp
To copy file1 to file2 type cp file1 file2
mkdir
To create a directory with name newdir type mkdir newdir
rmdir
To delete a directory (which must be empty) use the command rmdir
javac
To invoke the Java compiler on a unix machine use the command javac eg. javac x.java (note: you must first make sure the java commands can be accessed from your account -- see Using Java under SUnix.) This produces the file x.class.

Back to the PHY307 Homepage

This page maintained by Simon Catterall, last updated 21 August, 1997.