ch3- 文件系统中跳转

几个命令

  • cd -change directory
  • pwd -Pring name of current Working directory
  • ls -List directory contents

这几个命令都很容易理解。

绝对路径与相对路径

An absolute pathname begins with the root directory and follows the tree branch by branch until the path to the desired directory or file is completed.
Where an absolute pathname starts from the root directory and leads to its destination, a relative pathname starts from the working directory.
对于绝对路径,我们要列出整个的的文件路径进入,如:

cd /usr/local

而相对路径则是相对于当前工作目录而言,用...来操作,如

#当前目录 `/usr/local`,要进入`/usr` 有两种方法
cd /usr #绝对路径
cd ..     #相对路径

在进入子目录的时候,比如当前是/usr,进入子文件夹

cd ./local  

通常./是可以省略的,

cd local

有用的快捷键

cd            #到home directory
cd -          #到上一个工作路径
cd ~user_name #到某个用户的home directory
ls -a         #连隐藏文件也列出来
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容