Section 3.11. Printing Your Shell s Current Working Directory: pwd


[Page 52]

3.11. Printing Your Shell's Current Working Directory: pwd

Every Linux process has a location in the directory hierarchy, termed its current working directory. When you log into a Linux system, your shell starts off in a particular directory called your "home directory." In general, every user has a different home directory, which often begins with the prefix "/home." For example, my own home directory is called "/home/glass." The system administrator assigns these home directory values. To display your shell's current working directory, use the pwd utility (Figure 3-7).

Figure 3-7. Description of the pwd command.

Utility: pwd

Prints the current working directory.


To illustrate this utility, here's what happened when I logged into Linux to start work on my song's lyrics:

Fedora Core release 2 (Tettnang) Kernel 2.6.5-1.358 on an i686 bluenote login: glass Password:       ...secret. $ pwd /home/glass $ _ 


Figure 3-8 is a diagram that indicates the location of my login Korn shell in the directory hierarchy.

Figure 3-8. The login shell starts at the user's home directory.





Linux for Programmers and Users
Linux for Programmers and Users
ISBN: 0131857487
EAN: 2147483647
Year: 2007
Pages: 339

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net