一个简单的linux命令 pwd
更新时间:2016年12月22日 14:22:23 作者:liruopeng321
这篇文章主要介绍了一个简单的linux命令pwd,pwd命令用于查看当前工作目录的完整路径,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
pwd命令主要用于查看当前工作目录的完整路径。
主要用法:pwd [option]
常用范例:
1.查看当前完整路径
命令:pwd
输出:
[root@localhost ~]# pwd /root [root@localhost ~]#
2.查看链接路径
命令:pwd -P
输出:
[root@localhost soft]# cd /etc/init.d [root@localhost init.d]# pwd /etc/init.d [root@localhost init.d]# pwd -P /etc/rc.d/init.d
特性:当前目录被删除了,而pwd命令仍然显示那个目录
[root@localhost init.d]# cd /opt/soft [root@localhost soft]# mkdir removed [root@localhost soft]# cd removed/ [root@localhost removed]# pwd /opt/soft/removed [root@localhost removed]# rm ../removed -rf [root@localhost removed]# pwd /opt/soft/removed [root@localhost removed]# /bin/pwd /bin/pwd: couldn't find directory entry in “..” with matching i-node [root@localhost removed]# cd [root@localhost ~]# pwd /root [root@localhost ~]#
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。
相关文章
Ubuntu、Linux Mint一键安装Chrome浏览器的Shell脚本分享
这篇文章主要介绍了Ubuntu、Linux Mint一键安装Chrome浏览器的Shell脚本分享,本文直接给出实现代码,需要的朋友可以参考下2015-03-03
Linux tar 命令出现 Cowardly refusing to create an empty archive
这篇文章主要介绍了Linux tar 命令出现 Cowardly refusing to create an empty archive 错误解决办法的相关资料,需要的朋友可以参考下2017-04-04
shell脚本配合zabbix实现tomcat的故障自愈功能
这篇文章主要介绍了shell脚本配合zabbix实现tomcat的故障自愈,服务实现自愈的方式有通过shell脚本+定时任务的方式,蓝鲸Pass故障自愈平台,shell脚本+zabbix触发器动作,本文给大家详细介绍,需要的朋友可以参考下2022-03-03


最新评论