pwd-command-in-Hindi
click here to watch video know more
=> Find the full path to the current directory.
=> Store the full path to the current directory in the shell variable.
=> Verify the absolute path.
=> Verify the physical path i.e exclude symbolic links.
The current directory is nothing but the directory in which you are currently operating while using bash or ksh or zsh or tcsh/csh shell. You need to open a terminal (GUI) or login on a console to use a command line.
The syntax is:
pwd pwd [options] var=$(pwd) echo "The current working directory $var."
To print current working directory, enter:$ pwd
Sample outputs:
/home/vivek
In this example, /home/vivek is your current directory. The full path of any directory under Unix like operating systems always stats with a forward slash. In short:
To store current directory in a shell variable called x, enter:
x=$(pwd)
To print the current directory either use printf command or echo command:
echo "The current working directory : $x"
OR
printf "The current working directory : %s" $x
Most Unix users use the pwd command along with ls and cd commands:
## Where am I? pwd ## List the contents of the current directory ls ls -l # Change the current directory to Videos cd Videos pwd