Linux, Open Source, Free Software, Bicycles, and other topics of interest.
RSS icon Twitter icon
  • pwd – Linux Command to Print Working Directory

    Posted on March 9th, 2009 linuxandfriends No comments

    pwd is a Linux / Unix command which prints the current working directory. If you wish to know the full path of the  directory in which you are in from the Linux console, then the pwd command will come to your rescue. pwd stands for Print Working Directory.

    If you check the man page of pwd in Linux, you won\’t find any options for it. But in reality, pwd does have one option called -P, which lists the current working directory with all the links resolved.

    Usage of pwd command

    I have a directory called \”Examples/\” on my machine which is actually a soft link to the directory /usr/share/example-content/. If you are using Ubuntu Linux, you will also have this directory on your machine in your Home folder.

    I move into the \”Examples/\” directory and run the pwd command to get the following output.

    $ cd Examples
    $ pwd
    /home/laf/Examples

    Now if I pass the option -P with pwd, it will list the physical current working directory with all the links resolved.

    $ pwd -P
    /usr/share/example-content
    http://linuxandfriends.com/wp-content/plugins/sociofluid/images/digg_48.png http://linuxandfriends.com/wp-content/plugins/sociofluid/images/reddit_48.png http://linuxandfriends.com/wp-content/plugins/sociofluid/images/stumbleupon_48.png http://linuxandfriends.com/wp-content/plugins/sociofluid/images/delicious_48.png http://linuxandfriends.com/wp-content/plugins/sociofluid/images/google_48.png http://linuxandfriends.com/wp-content/plugins/sociofluid/images/myspace_48.png http://linuxandfriends.com/wp-content/plugins/sociofluid/images/facebook_48.png http://linuxandfriends.com/wp-content/plugins/sociofluid/images/yahoobuzz_48.png http://linuxandfriends.com/wp-content/plugins/sociofluid/images/mixx_48.png http://linuxandfriends.com/wp-content/plugins/sociofluid/images/twitter_48.png

    Related Posts

    Comments are closed.