In Linux (unix) filenames starting with a tilde "~"

Original: http://blog.csdn.net/chun_1959/article/details/23243935

 

In Linux (unix), filenames starting with a tilde "~" have special meaning.

 

Used alone or followed by a slash (~/), it represents the current user's home directory. (It can be viewed by the command "echo ~(~\)" under the shell). For example, "~/bin" represents "/home/username/bin/" (bin directory under the current user's home directory)

 

The tilde is followed by a word (~word) that represents the home directory of the user specified by this "word".

E.g

"~john/bin" represents the bin directory under the host directory of user john.

 

On some systems (like MS-DOS and MS-Windows), users do not have their own home directory, in which case the

Set the environment variable "HOME" to simulate.

 

cat -n test

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326873932&siteId=291194637