laitimes

One Linux command per day (cd)

author:Crud program ape

Function description: Toggles the current working directory

usage:

cd [dir]

Additional note: The cd directive allows the user to switch between different directories, but the user must have sufficient permissions to enter the destination directory. where dir can be an absolute path or a relative path. If the directory name is omitted, it is changed to the consumer's home directory (that is, the directory where it was just logined).

Other than that

~ is represented as a home directory

. Represents the directory in which it is currently located

.. Represents the directory above the current directory location

/ represents the root directory

example:

#跳转的用户的HOME目录

cd ~

#返回到上级目录

cd .. /

#返回上两级目录

cd .. /..

#跳转到绝对路径的指定目录, starting with /

cd /use/bin

#跳转到当前目录下的的bin目录

cd bin

Or cd ./bin

#跳转到根目录

cd /

#返回进入此目录之前所在目录

cd –

#把上个命令的参数作为cd参数使用

cd !$

For example:

echo /home

After the two commands are executed, the working directory switches to the /home directory

remark:

The root directory is a directory that is shared by all users

Read on