What is the difference between . (or ..) and ~ character with respect to how they are treated by the bash?
If i use ~ character, bash expands it to absolute path but if is use . (or ..) bash does not expand it to absolute path?
My pwd is home directory. Now, when i run the command: ls '.' (or ls .) it shows me the contents of the pwd but if i run the command: ls '~', it gives the error that the file or directory does not exists.
This means ~ is expanded by shell before passing it to the ls command but . is not.
Is . not a special character? When is . (or ..) treated as special character and expanded by the shell?
./and../directories? – Kamil Maciorowski May 07 '21 at 12:17~is only special when it is unquoted and when it is the first character of a word -- https://www.gnu.org/software/bash/manual/bash.html#Tilde-Expansion – glenn jackman May 07 '21 at 12:32.and..are not special to bash in any way, so they are the same quoted or unquoted. – glenn jackman May 07 '21 at 12:34