I am using Mac OS 10.10.3 and I am new to using Linux commands. This doubt I have -
Real working directory: / Dir _name
when i run this command: cd ~
Directory path changes to: ~ Dir_name
What does ~ or / change in the directory path mean?
~equivalent in itself $HOME. This applies to your home directory, usually something like /home/yourname.
~
$HOME
/home/yourname
~foorefers to the user's home directory foo.
~foo
foo
~ . , , fopen("~/foo/file.txt", "r") C, ~ ; , (, , ) , ~ .
fopen("~/foo/file.txt", "r")
/ .
/
cd cd ~ cd $HOME.
cd
cd ~
cd $HOME
cd ~ . cd $HOME
cd /
~ ./ .
cd / .
~ .
pwd ( ), , .
pwd
cd ~ pwd cd / pwd