Linux cd command is used to switch to the current user's home directory

Change directory command


learning target

  • Linux cd command can be used to switch to the current user's home directory

1. Change directory command using

command Explanation
cd directory Switch to the specified directory
cd ~ Switch to the current user's home directory
cd … Switch to the parent directory
cd . Switch to the current directory
cd - Switch to the last directory

note:

  • When the cd command to change the directory, the directory must exist.
  • cd do not write back catalog is equivalent to cd ~

cdDirectory renderings:

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-ilRPHheT-1583850015274) (imgs / cdml.png)]

cd ~Renderings:

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-sqtpHZww-1583850015275) (imgs / cdyhzml.png)]

cd ..Renderings:

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-srQnLdyt-1583850015275) (imgs / cdsyjml.png)]

cd .Renderings:

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-BOtGbJV3-1583850015276) (imgs / cddqml.png)]

cd -Renderings:

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-SwzaPI2O-1583850015276) (imgs / cddqml.png)]

2. Summary

  • cd directory command is a complete switching operation, when the switch directories, the directory must exist.
Published 698 original articles · won praise 929 · views 120 000 +

Guess you like

Origin blog.csdn.net/qq_35456045/article/details/104785084