Knowledgebase

Navigating Unix


Problem:

Basic Unix navigation commands



Solution:

/ (refers to the root directory on the server)
./ (the current directory that you are in)
../ (parent directory of your current directory)

pwd (shows what you current directory is - giving the full path)

ls (lists all the files in your current directory)
ls -al (lists filenames + information)
ls -alR (lists filenames + information in all subdirectories)
ls -alR | more (lists filenames + information in all subdirectories, pausing when the screen become full)
ls -alR > result.txt (lists filenames + information in all subdirectories, and ouputs the results to a file instead of the screen)
ls *.html (lists all files ending with .html)
ls -al /home/usr/bob/ (lists files + info for /home/usr/bob)

cd (changes you to a new directory)
ex: cd images will change you to the images directory
cd / (changes you to the root directory)
ex: cd /home/usr/images
cd .. (this goes back one directory)