Difference between til "~" and slash "/" at the linux prompt?

6

I'm starting a lower level part, where I'll schedule the users part, permissions and etc.

My first question is ~ and / at the prompt?

    
asked by anonymous 15.09.2017 / 13:53

2 answers

11

The ~ character refers to the home folder of the user. For example, if you type cd ~ into the terminal, the command will take you to the home folder of the user running the command.

/ refers to the starting point of Linux files. If you type cd / it will take you to the root of the operating system, where all the system folders are.

    
15.09.2017 / 13:59
5

Adding the answer:

The character til ~ is a alias associated with the home directory of the user, which can also be accessed through / , which is the starting point of the directories and also known as root .

cd , cd ~ , cd /home/marcelo , and cd $HOME are equivalent.

According to this topic in the SOen , the use of til for this association is due to Lear Siegler home and til and took the cursor to the beginning.

Lear-Siegler ADM-3A keyboard layout:

In GNU , there is documentation on the topic 3.5.2 Tilde Expansion about using ~ , where you can see the applications of your use.

    
15.09.2017 / 15:22