一个简单的linux命令 pwd
pwd命令主要用于查看当前工作目录的完整路径。
主要用法:pwd[option]
常用范例:
1.查看当前完整路径
命令:pwd
输出:
[root@localhost~]#pwd /root [root@localhost~]#
2.查看链接路径
命令:pwd-P
输出:
[root@localhostsoft]#cd/etc/init.d [root@localhostinit.d]#pwd /etc/init.d [root@localhostinit.d]#pwd-P /etc/rc.d/init.d
特性:当前目录被删除了,而pwd命令仍然显示那个目录
[root@localhostinit.d]#cd/opt/soft [root@localhostsoft]#mkdirremoved [root@localhostsoft]#cdremoved/ [root@localhostremoved]#pwd /opt/soft/removed [root@localhostremoved]#rm../removed-rf [root@localhostremoved]#pwd /opt/soft/removed [root@localhostremoved]#/bin/pwd /bin/pwd:couldn'tfinddirectoryentryin“..”withmatchingi-node [root@localhostremoved]#cd [root@localhost~]#pwd /root [root@localhost~]#
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持毛票票。