Question:
If you are in a subdirectory such as /PROJECTS/P1/A/A1/A11, what single command would you use to return to your home directory from the current working directory?
Answer:
The easiest but not only way to return to user's home directory from any directory within a filesystem is to use cd command without any options and arguments.
$ cd
it is also possible to use:
$ cd ~
OR
$ cd $HOME
OR
$ cd ~/
However, if your home directory was a last directory you have visited previously before you navigated to /PROJECTS/P1/A/A1/A11 you can also use:
$ cd -
ARE YOU LOOKING FOR A LINUX JOB?
Submit your RESUME, create a JOB ALERT or subscribe to RSS feed on LinuxCareers.com.
LINUX CAREER NEWSLETTER
Subscribe to NEWSLETTER and receive latest news, jobs, career advice and tutorials.
DO YOU NEED ADDITIONAL HELP?
Get extra help by visiting our LINUX FORUM or simply use comments below.

You may also be interested in:



Comments and Discussions