Difference between "~" tilde and "/" bar at linux prompt?

Asked

Viewed 3,359 times

7

I am starting a lower level part, where I will program the part of users, permissions and etc.

My first question is ~ and / at the prompt ?

2 answers

12


The character ~ remit the folder home user. For example if you type cd ~ in the terminal, the command will take you to the home folder of the user that is running this command.

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

  • 2

    You also have the option of cd ~outrouser who goes to the home of outrouser

  • I rejected your edition because the doubt is not about terminals, and about the same prompt...

  • Relax! I just thought it would be better for future research because it is not common to use the term prompt in linux.

6

Making an Addendum to the Answer:

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

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

According to this topic in Soen, the use of til for this association is due to the Lear SieglerADM-3A, that had the same key to homeand til and carried the cursor to the beginning.

Lear-Siegler ADM-3A keyboard layout: inserir a descrição da imagem aqui

In the WILDEBEEST, there is documentation in the topic 3.5.2 Tilde Expansion on the use of ~, where you can see the applications of its use.

  • 1

    Interesting that the movement keys of vi also came from that keyboard there!

  • Yes yes, there’s that detail too.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.