next up previous contents index
Next: File Manipulation Up: Basic Bash Commands Previous: Basic Bash Commands   Contents   Index

Moving Around the System

When you first login you will be sitting in your home directory. Most likely /home/username/. You can get a listing of the directory contents by typing:

$ ls
or for a long view of the listing with time stamps, file permissions and file ownerships type:

$ ls -l
You can move from directories by typing

$ cd directory-name
cd by itself will bring you back to your home directory.

Directories are referenced with a slash ( / ). / being the root directory. So to go to the /etc directory you simply type

$ cd /etc
to reference the current directory we use a single period, '.' and to reference the previous directory we use two periods, '..'. So if you are in your home directory and you want to go to a different users directory you can type:

$ cd images/different-user
which is equivalent to:

$ cd /home/different-user
At any point using the TAB key after typing a few characters in at the bash prompt will make bash fill in the rest of the file. or directory name that matches what you have typed. If there is more than one match, tap the tab key twice and it will list all the matches.


next up previous contents index
Next: File Manipulation Up: Basic Bash Commands Previous: Basic Bash Commands   Contents   Index