Linux中的~/和~有什么区别?
What is the difference between ~/ and ~ in Linux?
我是Linux新手,用了一年多一点。谁能帮我解决我的问题?
当我使用 ~/
时,它只显示用户主目录。为什么在单独使用~
指定文件或目录路径的情况下不起作用?
~
表示登录用户的主目录,而 ~/
表示目录开头的路径。
来自here:
The tilde (~) is a Linux "shortcut" to denote a user's home directory.
Thus tilde slash (~/) is the beginning of a path to a file or
directory below the user's home directory.
旁注 如果您看到类似 ~Gowthaman/
那么它将是用户 Gowthaman 主目录
我是Linux新手,用了一年多一点。谁能帮我解决我的问题?
当我使用 ~/
时,它只显示用户主目录。为什么在单独使用~
指定文件或目录路径的情况下不起作用?
~
表示登录用户的主目录,而 ~/
表示目录开头的路径。
来自here:
The tilde (~) is a Linux "shortcut" to denote a user's home directory. Thus tilde slash (~/) is the beginning of a path to a file or directory below the user's home directory.
旁注 如果您看到类似 ~Gowthaman/
那么它将是用户 Gowthaman 主目录