0

I am using the bash console for Ubuntu and my console location is

user@MyServer:~$

If user@MyServer:/$ is the root directory, what is user@MyServer:~$ ?

fedorqui
  • 275,237
  • 103
  • 548
  • 598
Andrew
  • 1,696
  • 2
  • 16
  • 20

5 Answers5

1

As noted in other replies, it's your home directory, which is shortened to ~.

You can find out what directory you're in using the pwd command. eg:

[atticus:pgl]:~ $ pwd
/home/pgl
pgl
  • 7,551
  • 2
  • 23
  • 31
1

~ represents your home directory. If you are logged in as root, this will typically be /root if you are logged in with another user (say with username user) this will typically be /home/user. The best way to know for certain though is either run echo ~ which will print where ~ points to, or you can run the pwd command while in ~ which will show your present working directory - this command is generally useful to know when navigating.

flungo
  • 1,050
  • 1
  • 7
  • 21
1

“user@MyServer:~$” is the command prompt. You can echo $PS1 to see the setting of your environment.

bestwolf1983
  • 170
  • 1
  • 6
0

Its your home directory you can go to your home directory by cd ~

Rahul R Dhobi
  • 5,668
  • 1
  • 29
  • 38
0

Not always, you can list all users' home directory by:

cut -d : -f1,6 /etc/passwd

so you will get different paths, some under /export/home/USERNAME, some under /home/USERNAME, some has no home directory. For root account, normal / is its home directly.

BMW
  • 42,880
  • 12
  • 99
  • 116