Linux Babble 123-reg - Cheap domain names, free configuration

Definition of ‘Current directory’

The current directory or working directory is the Unix concept of ‘where you are now’. Commands run from a shell usually look for files in the current directory unless you explicitly tell them to look elsewhere.

In a Unix or Linux shell, the cd command will change your current directory:

$ cd /usr/share/doc

Just running cd without any arguments will take you back to your home directory. Giving cd the option - will take you back to the last directory you were in.

The command pwd will print your current working directory:

$ pwd
/home/fred

Note that each process on a Unix system has its own working directory. When one program (such as a shell) runs another, the new process inherits the same current directory. It is rare for programs to change their current directory, except for the shell with its cd command.