Linux basic commands cd
Switch directory command function of cd: Switch the current directory to dirName; a folder in Windows, which is called a directory in Linux. A directory is a container that contains several sets of files and other directories. All directories are extended from the root directory, which is indicated by a forward slash. For example,/usr is a sub-directory of the root directory. The/usr/spool directory is a sub-directory of/usr. The/usr/spool/mail directory is a sub-directory of/usr/spool. Command Format: [root @ ilinux ~] # Command parameters of the cd target directory:
Command instance: instance 1: Enter the system root directory [root @ ilinux data] # cd/[root @ ilinux/] # pwd/[root @ ilinux home] # cd .. [root @ ilinux/] # pwd/instance 2: Enter the current user's home directory [root @ ilinux/] # cd [root @ ilinux ~] # Pwd/root [root @ ilinux home] # cd ~ [Root @ ilinux ~] # Pwd/root instance 3: go to the [root @ ilinux data] # cd/[root @ ilinux/] # pwd/[root @ ilinux/] # cd-/data [root @ ilinux data] # pwd/data