cd是linux的内建命令,用于目录之间的切换;
参数:
-P:当目录是软连接的时候,切换的物理真实路径
-L:当目录是软链接的时候,依然使用软链接路径 SourceByrd's Weblog-https://note.t4x.org/rebuilding/cd-command-description/
用法:SourceByrd's Weblog-https://note.t4x.org/rebuilding/cd-command-description/
[root@Test5 tmp]# cd --help
-bash: cd: --: invalid option
cd: usage: cd [-L|-P] [dir] SourceByrd's Weblog-https://note.t4x.org/rebuilding/cd-command-description/
案例:
0 1 2 3 4 5 6 7 |
[root@Test5 tmp]# cd -P nginx [root@Test5 nginx]# pwd /usr/local/nginx [root@Test5 nginx]# cd - /tmp [root@Test5 tmp]# cd -L nginx [root@Test5 nginx]# pwd /tmp/nginx |
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!