SysAdmin Blog, TechTips and Reviews

Unix SysAd's Technology Blog




pwd – Most Used UNIX Command

January 24th, 2009 by elizar

pwd is probably the most widely used UNIX (or Unix-like) command! ls (el-es) could also be the most used but we will be talking about pwd here, so let’s say that ‘pwd’ is the most widely used shall we?

What is pwd?

pwd, when executed at the shell (prompt) will print out the current working directory in the standard output of the system, which is the monitor.

pwd could be and abbreviation for ‘print working directory’ or ‘present working directory’ or make up your own definition.. there’s no rule.

WIkipedia says:

In Unix-like and some other operating systems the pwd command (print working directory) is used to output the path of the current working directory.

The command is a shell builtin in certain Unix shells such as sh, and bash. It can be implemented easily with the POSIX C functions getcwd() and/or getwd().

The equivalent on DOS (COMMAND.COM) and Microsoft Windows (cmd.exe) is the “cd” command with no arguments. Windows PowerShell provides the equivalent “Get-Location” cmdlet with the standard aliases “gl” and “pwd”. The OpenVMS equivalent is “show default”.

Example:

$ pwd
/home/foobar

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
Filed under Commands having No Comments »

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.