Academic and Research Computing
QUICK STUDY #2
February 2003

Useful UNIX Commands

Type those commands shown in Bold type exactly as shown. Items which appear in italic type should be replaced with the name of a specific file, printer, etc.

Please note that you need not necessarily be on an RCS UNIX machine in order to use these commands; you can also initiate a SecureCRT session to an RCS host (for example, rcs-ibm.rpi.edu) from a PC. SecureCRT is pre-installed on all Rensselaer laptops. If you would like instructions for obtaining the SecureCRT license, click on the Academic & Research Computing link under the ``Computing Services" section of the RPInfo homepage, then select the Software to install, and SecureCRT links.



Working with Files and Directories

To do this: Enter this in a UNIX window:
Create a directory mkdir directoryname
Change directories cd directoryname
To change to your home directory cd  
To change to parent directory cd ..
Print working (current) directory pwd
List access to a directory fs la
List files in a directory ls
List files including size, etc. ls -l
List all files (including hidden files) ls -a
Display contents of file on screen more filename
Copy one file to another cp origfilename newfilename
Move (rename) a file mv filename1 filename2
Create a file alias (symbolic link) ln -s origfilename aliasfilename
Remove (delete) a file rm filename
Remove all files in a directory (be careful!!) rm *
Remove an empty directory rmdir directoryname
Remove a directory and all its files rm -r directoryname
Edit a file emacs filename
  vi filename
  nedit filename
Search a file for pattern grep pattern filename
Append a second file to the first file cat filename2 >> filename1



Printing

To do this: Enter this in a UNIX window:
Print a file on the default printer lpr filename
Print a file and select printer lpr -Pprintername filename
Check the print queue lpq or lpq -Pprintername
Cancel a print job lprm jobnumber or lprm -Pprintername jobnumber
Check your printing allocation pagestatus

Account-related Activities

To do this: Enter this in a UNIX window:
Change your password passwd
Get help on a command or program man command
Check your disk quota fs lq
Increase your disk quota (extra charge) quota_request -quota # (total # of MB wanted)
Reset your disk quota quota_request -reset



Working with PC files

To do this: Enter this in a UNIX window:
Copy file from RCS to the a:(floppy) drive mcopy filename a:filename
Copy file from the a:(floppy) drive to RCS mcopy a:filename filename
List files on the a:(floppy) drive mdir a:
Eject floppy disk from drive (if no button) meject



Additional Information

For more information on UNIX commands and text editors, see memo RPI.113, Using UNIX: The Rensselaer Computing System (RCS).


About this document ...

Published by Academic and Research Computing, RPI, Troy, NY 12180

Send comments to consult@rpi.edu.