Popular Commands
The number of commands on a typical Unix system is enough to fill a few hundred reference pages. And you can add new commands too. The commands we’ll tell you about here are just enough to navigate and to see what you have on the system.
Directories
Like MS-DOS, and virtually every modern computer system, Unix files
are organized into a hierarchical directory structure. Unix imposes
no rules about where files have to be, but conventions have grown up
over the years. Thus, on Linux you’ll find a directory called
/home where each user’s files are placed. Each user has a
subdirectory under /home. So if your login name is mdw,
your personal files are located in /home/mdw. This is called
your home directory. You can, of course, create more subdirectories
under it.
As you can see, the components of a directory are separated by slashes. The term pathname is often used to refer to this slash-separated list.
What directory is /home in? The
directory named
/ of course. This is called the root directory. We have
already mentioned it when setting up file systems.
When you log in, the system puts you in your home directory. To verify this, use the “print working directory” or pwd command:
$ pwd
/home/mdw
The system confirms that you’re in /home/mdw.
You certainly won’t have much fun if you have to stay in one directory all the time. Now try using another command, cd, to move to another directory:
$cd /usr/bin$pwd/usr/bin $cd
Where are we now? A cd with no arguments returns ...