Linux Command Detailed command of -pwd

The Linux pwd command is a very commonly used commands, we introduce in the Linux pwd command usage.

For more details see Linux commands: Linux Command Cheat Sheet

pwd command

Linux pwd command to display the working directory.

Pwd command can be executed immediately know the absolute path name of your current working directory is located.

A, Linux pwd command syntax

pwd [OPTION]...

Parameter Description:

Copy the code
-L, --logical    #use PWD from environment, even if it contains symlinks

-P, --physical    #avoid all symlinks

--help         #display this help and exit

--version       #output version information and exit
Copy the code

When -L directory connection link, a connection path output

-P output physical path

Two, Linux pwd command examples

View current directory:

#pwd
/root/linuxdaxue.com/testDir

View link path

Copy the code
#pwd 
/etc/rc.d/init.d
#pwd -P
/etc/rc.d/init.d
#pwd -L
/etc/init.d
Copy the code

Wrote environment variables

export PS1='[\u@$PWD]\$'

In this way in front of the command prompt will display the current directory

As follows:

[root@/root/linuxdaxue.com/testDir]#

ok, about the Linux pwd command of relevant content to just give you about here.

Guess you like

Origin www.cnblogs.com/zhuyeshen/p/11425534.html