Working Directory |
Linux Commands - Shells |
The Working Directory is the location of the directory that you are currently in. For example if you log into the system, it is designed so that you will begin in your home directory. For example, if your username was tom then your home directory by default would be /home/tom. When tom logs into the system it places him in the /home/tom directory, which is the current working directory. So if tom issues the command ls, then it will list the contents of /home/tom. If tom moves to the /usr directory by using the command cd /usr (which means change directories to /usr) then the current working directory is /usr Current working directory is the current directory that a command will interact with. Now, that does not mean that you have to be located in a directory to issue a command in the shell. Regardless of your current working directory you can use a command that interacts with any directory by using a path. For example, if you were located in the /home/tom directory you could list the contents of the /usr/share directory by using the path of that directory so the command would look like this:
Copyright CyberMontana Inc. and BeginLinux.com All rights reserved. Cannot be reproduced without written permission. Box 1262 Trout Creek, MT 59874
|