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
In your first portion root@raselkhan:~# pwd
, the username is root
and the directory you are currently in is ~
i.e. home directory. As the user is root
and the home directory of root
is /root
, pwd
command rightly showing the print working directory as /root
.
Now in your second portion khan@raselkhan:~# pwd
, the username is khan
and the current directory is ~
which again means the home directory of the user. As the user in this case is khan
so the pwd
will show /home/khan
(i think you have mistakenly typed /khan/home
).
root
. The pwd
command will show /home/khan
when the prompt starts with khan@raselkhan:~
.
root
's home directory orcd
to your home directory?sudo -i
. If you don't want that, don'tsudo
.sudo -s
instead (a shell but not a login shell)