您现在的位置是:网站首页> 编程资料编程资料
一个简单的linux命令 pwd_linux shell_
2023-05-26
425人已围观
简介 一个简单的linux命令 pwd_linux shell_
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 ~]#
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
您可能感兴趣的文章:
相关内容
- 一个简单的linux命令 mkdir_linux shell_
- 深入理解Shell输出颜色与控制_linux shell_
- shell(bash)下“time” 命令的输出详解_linux shell_
- Shell交互批量更改主机名的方法_linux shell_
- shell两个文件去重的多种姿势_linux shell_
- 用Shell判断字符串包含关系的方法小结_linux shell_
- Linux运维常用命令_linux shell_
- linux下执行shell命令方法简介_linux shell_
- 使用Shell 脚本实现每隔100行插入一条记录且记录第一列包含行号其他列不变_linux shell_
- linux下怎么解压.tar.gz .tar.bz2命令_linux shell_
