I want to change root directory back to home directory, how can I achieve this?
What I have now:
root@raselkhan:~# pwd
/root
What I had before:
khan@raselkhan:~# pwd
/khan/home
I want to change root directory back to home directory, how can I achieve this?
What I have now:
root@raselkhan:~# pwd
/root
What I had before:
khan@raselkhan:~# pwd
/khan/home
If I understand you correctly, you can always:
And then
pwd
again.In your first portion
root@raselkhan:~# pwd
, the username isroot
and the directory you are currently in is~
i.e. home directory. As the user isroot
and the home directory ofroot
is/root
,pwd
command rightly showing the print working directory as/root
.Now in your second portion
khan@raselkhan:~# pwd
, the username iskhan
and the current directory is~
which again means the home directory of the user. As the user in this case iskhan
so thepwd
will show/home/khan
(i think you have mistakenly typed/khan/home
).