淄博网站建设选择臻动传媒,有没有个人做网站赚钱,郴州网红景点,家居企业网站建设渠道Linux中用 pwd 命令来查看”当前工作目录“的完整路径。 简单得说#xff0c;每当你在终端进行操作时#xff0c;你都会有一个当前工作目录。 在不太确定当前位置时#xff0c;就会使用pwd来判定当前目录在文件系统内的确切位置。 1#xff0e;命令格式#xff1a; pwd […Linux中用 pwd 命令来查看”当前工作目录“的完整路径。 简单得说每当你在终端进行操作时你都会有一个当前工作目录。 在不太确定当前位置时就会使用pwd来判定当前目录在文件系统内的确切位置。 1命令格式 pwd [选项] 2命令功能 查看”当前工作目录“的完整路径 3常用参数 一般情况下不带任何参数 如果目录是链接时 格式pwd -P 显示出实际路径而非使用连接link路径。 4常用实例 实例1用 pwd 命令查看默认工作目录的完整路径 命令 pwd 输出 [rootlocalhost ~]# pwd /root [rootlocalhost ~]# 实例2使用 pwd 命令查看指定文件夹 命令 pwd 输出 [rootlocalhost ~]# cd /opt/soft/ [rootlocalhost soft]# pwd /opt/soft [rootlocalhost soft]# 实例三目录连接链接时pwd -P 显示出实际路径而非使用连接link路径pwd显示的是连接路径 命令 pwd -P 输出 [rootlocalhost soft]# cd /etc/init.d [rootlocalhost init.d]# pwd /etc/init.d [rootlocalhost init.d]# pwd -P /etc/rc.d/init.d [rootlocalhost init.d]# 实例4/bin/pwd 命令 /bin/pwd [选项] 选项 -L 目录连接链接时输出连接路径 -P 输出物理路径 输出 [rootlocalhost init.d]# /bin/pwd /etc/rc.d/init.d [rootlocalhost init.d]# /bin/pwd --help [rootlocalhost init.d]# /bin/pwd -P /etc/rc.d/init.d [rootlocalhost init.d]# /bin/pwd -L /etc/init.d [rootlocalhost init.d]# 实例五当前目录被删除了而pwd命令仍然显示那个目录 输出 [rootlocalhost init.d]# cd /opt/soft [rootlocalhost soft]# mkdir removed [rootlocalhost soft]# cd removed/ [rootlocalhost removed]# pwd /opt/soft/removed [rootlocalhost removed]# rm ../removed -rf [rootlocalhost removed]# pwd /opt/soft/removed [rootlocalhost removed]# /bin/pwd /bin/pwd: couldnt find directory entry in “..” with matching i-node [rootlocalhost removed]# cd [rootlocalhost ~]# pwd /root [rootlocalhost ~]#转载于:https://www.cnblogs.com/duanxz/p/5037780.html