美文网首页
ch3- 文件系统中跳转

ch3- 文件系统中跳转

作者: Klaas | 来源:发表于2016-02-27 13:56 被阅读11次

几个命令

  • 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         #连隐藏文件也列出来

相关文章

网友评论

      本文标题:ch3- 文件系统中跳转

      本文链接:https://www.haomeiwen.com/subject/xamwkttx.html