01-Linux命令【pwd】


1、命令简介

pwd(print work directory 打印当前目录)命令以绝对路径的方式显示用户当前工作目录。

2、用法

pwd  [-LP]

3、选项

-L    --logical    当目录为连接路径时,显示连接路径
-P    --physical    显示实际物理路径,而非使用连接(link)路径

4、实例

1:显示当前目录所在路径 pwd

[root@cent6 ~]# pwd
/root
 

2:显示当前目录的物理路径 pwd –P

[root@cent6 ~]# cd /etc/init.d 
[root@cent6 init.d]# pwd -P
/etc/rc.d/init.d

3: 显示当前目录的连接路径:pwd -L

[root@cent6 init.d]# cd /etc/init.d 
[root@cent6 init.d]# pwd -L
/etc/init.d


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM