在Linux中的bash波浪号的含义(而不是主目录) [英] Meaning of tilde in Linux bash (not home directory)
问题描述
首先,我知道〜/
是主目录。 CDing到〜
或〜/
带我到主目录。
First off, I know that ~/
is the home directory. CDing to ~
or ~/
takes me to the home directory.
然而, CD〜X
带我去一个特别的地方,其中 X
好像是什么。
However, cd ~X
takes me to a special place, where X
seems to be anything.
在bash中,如果我打 CD〜
,打标签,它显示了一堆可能的〜X
如〜邮件
和〜Postgres的
和〜SSH
。将这些文件夹并做了 PWD
让我发现,这些文件夹不在主目录;他们是所有的地方。
In bash, if I hit "cd ~
" and hit tab, it shows a bunch of possible ~X
options like ~mail
and ~postgres
and ~ssh
. Going to those folders and doing a pwd
shows me that these folders are not in the home directory; they're all over the place.
它们不是别名。我检查。
他们不是 ENV。
变量,否则他们会要求 $
。
They are not aliases. I've checked.
They're not env.
variables, or else they'd require a $
.
什么是设置这些链接,和我在哪里可以找到这些的地方正在建立?
What is setting these links, and where can I find where these are being set?
推荐答案
这些都是用户的主目录。尝试 CD〜(您的用户名)
,例如
Those are the home directories of the users. Try cd ~(your username)
, for example.
这篇关于在Linux中的bash波浪号的含义(而不是主目录)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!