Linux / UNIX: Print Current Working Directory with pwd command
Q. How do I display the absolute path to the current working directory under Linux or UNIX operating system?
A. The pwd command displays the absolute pathname of the current working directory to the computer screen.
Print name of current/working directory
Type pwd command:
pwd
Output:
/home/vivek
Above command print the full filename of the current working directory i.e /home/vivek.
Display actual directory location
Use -P option to display the physical current working directory (all symbolic links resolved). For example, /home/lighttpd is /var/www/root/lighttpd:
cd /home/lighttpd
pwd
Output:
/home/lighttpd
Now run with -P option
pwd -P
Output:
/var/www/root/lighttpd
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Other Helpful FAQs:
- Understanding Linux / UNIX Relative Pathname
- How to include files with PHP
- UNIX / Linux: Absolute Pathnames
- Linux tape backup with mt and tar command - howto
- Examining the Linux / FreeBSD / UNIX filesystem with ls command
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: absolute_path, absolute_pathname, command_pwd, Linux, pwd_command, type_pwd, UNIX, unix_operating_system



Recent Comments
Today ~ 1 Comment
Today ~ 3 Comments
Today ~ 57 Comments
Yesterday ~ 9 Comments
Yesterday ~ 7 Comments