Linux pwd command tutorial
The pwd command is used quite often in the Unix command line environment where the shell doesn't show the name of the working directory. Type 'pwd' in the command line will print the name of current/working directory. In Linux, where bash is the default shell, we can always see what directory we are in. The name of the current directory is shown at the command prompt after the host name. See the example below:
bill@slackware:~$
|
The '~' shows our current directory is the user's home directory. We can confirm that with the Linux pwd command:
bill@slackware:~$ pwd
/home/bill
|
Now let's change to another directory:
bill@slackware:~$
bill@slackware:~$ cd /home/ftp
bill@slackware:/home/ftp$
|
When we change the directory to /home/ftp directory, the '~' has changed to our current directory. If we check again with Linux pwd command, we would get the result as in the example below:
bill@slackware:~$ pwd
/home/ftp
|
The Linux pwd command doesn't have any other option except for '-LP' which will print the same result as example above. If you open the pwd manual page, there are no '-L' or '-P' options. The supplied options '--help' and '--version' options would give you 'invalid option' when used with pwd command in Ubuntu desktop such as in the example below:
kucing@ubuntu-laptop:~$ pwd --help
bash: pwd: --: invalid option
pwd: usage: pwd [-LP]
|
That's all.
Back to Other important Linux basic commands main page.
Popular content



Delicious
Digg
StumbleUpon
Propeller
Reddit
Newsvine
Furl
Facebook
Google
Yahoo
Technorati
Icerocket
Post new comment