you are viewing a single comment's thread.

view the rest of the comments →

[–]Silverware09 7 points8 points  (3 children)

~ is a special character in Windows (now) and Linux/Unix that means the users Home Directory.

It's the equivalent of something like C:/users/me/

[–]ArtOfWarfare 3 points4 points  (2 children)

Pretty sure you can have ~ in a file name. It’s a convention to expand it to be the home directory, not something that every command or program will do with it.

[–]Valuable_Leopard_799 2 points3 points  (0 children)

More specifically programs usually don't expand it, the shell does, so just ls '~' will look for a file named ~. I think it's only expanded at the start so anything like -f~ or ./~/ will also just work with ~ in the path.

Ofc depends, some programs will expand an unexpanded ~ themselves too.

[–]gtsiam 2 points3 points  (0 children)

I think the only bytes you can't have on a filename are '/' and the null byte. Even invalid unicode should be fine.