PWD command in Linux – syntax, choices, use, and example
PWD stands for Print Working Directory. It prints the whole absolute path of the present listing you’re in.
While working with Linux information and directories, you progress round from one listing to a different one. Anytime if you wish to know in which listing you’re in then, the pwd command tells you that.
syntax of PWD command in Linux
pwd [ -LP ]
Where L and P are non-compulsory choices.
|-L||Displays the logical path of present working listing. This logical path contains the symbolic hyperlink path of the present working listing.
This is the default choice if no choices specified.
|-p||Displays the bodily path of present working listing after resolving symbolic hyperlinks. It reveals the total pathname without a symbolic hyperlink of the present working listing.|
Note: When no choice is specified with the command PWD, it mechanically considers -L into motion.
PWD example in Linux
Let us try some enjoyable with pwd command and see the place we exist.
To know the present working listing simply hit both pwd or pwd -L in any listing.
pwd or pwd -L each are equal.
Let us now try pwd with -P choice. Since it shows the bodily path of present working listing after resolving symbolic hyperlinks. Hence we have to create a symbolic hyperlink to check.
C Programming Recommended Post
- Introduction to C Programming – Setup CodeBlocks
- Learn to Write Your First C Program – Print Hello Computer
- Understand C Variables with Flowcharts and Examples
- C Datatypes Explained with Flowcharts and Examples
- C Operators Learn the Basics of Programming Step by Step
- C Decision Making: If, If-Else, Switch-Case Statements
- C While and Do-While Loops Explained with Examples
- C For Loop – Learn Its Purpose with Flowchart, and Example
- Word Frequency in a Python String | Multiple Techniques – My programming school
- How C Programming Contributes To Machine Learning and its Algorithms