Select Page

How to Use Basic Unix Commands

UNIX Commands

Command Description
ls dir List current (or specified) directory
ls -al dir Show long listing of current (or specified) directory
cd Change to home directory
cd dir Change to specified directory
pwd Show present working directory
mkdir dir Make specified directory
rm file1 ... n Remove file(s)
rm -r dir1 ... n Remove directory or directories
cp file1 file2 Make a copy of file1 called file2
mv file1 file2 Rename file1 to file2
mv dir1 dir2 Rename dir1 to dir2
mv file dir Move file to directory
chmod ugo file Change read, write, execute permissions
chmod ugo dir r(read)=4, w(write)=2, x(execute)=1
Add permissions, so 3=write and execute
Example: chmod 711 ~/www
~ Same as home directory.
Example:cd ~/www
. Same as current directory.
Example: cp ~/test .
.. Same as directory above.
Example: cd ../../
* Same as all files.
Example: chmod 711 *
| pipe output of one program to another.
Example: ls -al | grep word | more
passwd Change password
pqi Paper quota info
showdq Show disk quota
clear Clear the screen
forward Forward your email
rm .forward Stop forwarding your email