• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

pwd Command Examples in Linux

by admin

In Linux and other Unix-like operating systems, the pwd command stands for “print working directory.” It is a command-line utility that allows you to display the full path of the current working directory.

To use the pwd command, simply type pwd at the command prompt and press Enter. The command will output the full path of the current working directory, for example:

$ pwd
/home/user/documents

You can also use the pwd command with certain options to modify its behavior. For example, the -L option causes the pwd command to follow symbolic links and print the actual path of the link, rather than the path of the link’s target. The -P option, on the other hand, causes the pwd command to print the physical directory structure, rather than following symbolic links.

pwd Command Examples

1. To get the current working directory:

# pwd 

2. To get the present working directory from environment:

# pwd -L
# pwd --logical 

3. To avoid all symlinks:

# pwd -P
# pwd --physical 

4. To get the pwd help:

# pwd --help

5. To get the pwd version info:

# pwd --version 

Filed Under: Linux

Some more articles you might also be interested in …

  1. pmap Command Examples in Linux
  2. perf: command not found
  3. logsave: command not found
  4. How to check change log of RPM packages on CentOS/RHEL
  5. playerctl Command Examples in Linux
  6. How to Trace Python Scripts using trace.py
  7. CentOS / RHEL 6 : How to force a NTP sync with the NTP server(s)
  8. less: command not found
  9. “comm” Command in Linux with Examples
  10. mount: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright