|
In bash, the '~' character is a shortcut for your home directory. If you need a literal '~' character, then you have to escape it with a backslash: '/~'. The same goes for most other "illegal" filename characters, such as parentheses, quote marks, exclamation points, and especially spaces.
Also, don't forget tab-completion. Hitting the tab key when typing a filename will autofill whatever names it sees that match what you've already typed. It can often help when matching those oddball characters.
When using a file with illegal characters in a command, you can either use the backslash-escape as above, or enclose the whole filename in quotation marks so that bash will see the thing as single unit.
I suggest you get in the habit of keeping your filenames clean. Use underscores or hyphens instead of spaces, and leave out illegal characters as much as possible. It will save you some frustration. I also personally keep most of my filenames in lowercase letters only, since Linux is case-sensitive, but that's not strictly necessary.
|