-2

I know that $ is a non-root user and # indicates a root user, similarly trying to understand the basic difference in the representation for a root user with the syntax "/#" and "~#".

root@a145f139efec:/# pwd
/
root@a145f139efec:/# whoami
root
root@a145f139efec:/# su -
root@a145f139efec:~# pwd
/root
root@a145f139efec:~# whoami
root
root@a145f139efec:~# 
4

Both symbols before the # represent the current directory you're in. In your first example you are in the / directory. Entering su - then changes you to root's home directory, which is /root. The ~ symbolizes the home directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.