~
(tilde) si espande al valore della variabile HOME
che è impostata dal processo login
o al valore impostato in uno dei file di configurazione della tua shell.
Dalle pagine man:
HOME - The home directory of the current user; the default argument for the cd builtin command. The value of this variable is also used when performing tilde expansion.
Tilde Expansion - If a word begins with an unquoted tilde character ('~'), all of the characters preceding the first unquoted slash (or all characters, if there is no unquoted slash) are considered a tilde-prefix. If none of the characters in the tilde-prefix are quoted, the characters in the tilde-prefix following the tilde are treated as a possible login name. If this login name is the null string, the tilde is replaced with the value of the shell parameter HOME. If HOME is unset, the home directory of the user executing the shell is substituted instead. Otherwise, the tilde-prefix is replaced with the home directory associated with the specified login name.
Nel tuo caso (supponendo che tu non abbia cambiato HOME
), usando ~/bin
, ~/usr
, ~/local
li espandi a /Users/myname/bin
, /Users/myname/usr
, /Users/myname/local
.
Se quello che vuoi è nella cartella radice del tuo sistema, non mettere il ~
(lascia solo /
in primo piano).
Riferimenti: man page per bash / man bash