Skip to Content
Running Linux, Third Edition
book

Running Linux, Third Edition

by Matthias Kalle Dalheimer, Lar Kaufman, Matt Welsh
August 1999
Beginner
760 pages
23h 55m
English
O'Reilly Media, Inc.
Content preview from Running Linux, Third Edition

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Running Linux, 5th Edition

Running Linux, 5th Edition

Matthias Kalle Dalheimer, Matt Welsh
Linux Under the Hood

Linux Under the Hood

Sander van Vugt

Publisher Resources

ISBN: 156592469XCatalog PageErrata