In: Computer Science
1. What command is used to change the current working directory at the command line?
In Linux, to change the current working directory at the
command line you could use the below command:
cd
"cd" is the acronym for "change directory". An example command
to move one directory or folder upwards into the current working
folder or directory's parent folder, type in the below command at
the command prompt:
$ cd ..
If you have a directory name called "Test" in the current
working directory. Use the below command to go into the "Test"
directory. Example:
cd Test
If you want to navigate to your home directory, type in
cd
cd ~
If you want to navigate to the previous directory you were in,
type in the below command:
cd -
If you want to navigate into the root directory, type in the
command:
cd /
You can also provide the absolute path to the directory you want
to navigate to in case you are in a different drive or directory
other than the home directory by typing in the below command:
cd /home/user/Videos
Where the "user" is the name of the user logged into the Linux machine.