Basic UNIX Navigation Commands

The following basic UNIX commands can help you navigate the UNIX file system.

Command

Example

Function

ls

ls

ls -l

ls -al

ls /usr/home

list files in the current directory

list files in the current directory in a long listing

list all files including files beginning with a "."

list files in the /usr/home directory

pwd

pwd

print working directory - check the current directory

cd

cd

changes to your assigned home directory

cd /usr/home

change directory to /usr/home

cd bob

change directory to bob

cd ..

change up one directory (.. represents parent dir)

cd ../logs

change up one directory and down to the logs directory

mkdir

mkdir tmp

make directory tmp under the present directory

rmdir

rmdir tmp

remove directory tmp

rm

rm test

remove the file test

rm -f test

remove the file test without prompting

rm -rf tmp

remove the tmp directory and all subdirectories and files in tmp without prompting (be very careful with this)

cp

cp test test.new

copy the file test to test.new

The following is a list of file system symbols and definitions:

Symbol

Definition

.

Current directory

..

Parent directory

/

When used by itself or at the beginning of a path it represents the root directory. When used within a path it is a separator.

~

Alias for the path to users home directory /usr/home/login_name.

.


Note: If you are logged in as Bob and your home directory is /usr/home/bob, then cd ~/etc would change to /usr/home/bob/etc.

Back