lsWhat now a$file prog|.c program.c
When you type those filenames on the command line, the shell interprets the special characters (space, dollar sign, and vertical bar) instead of including them as part of the filename. There are 8.5 explains, the shell doesn't scan the filenames for other special characters after it interprets the wildcards, so you're (usually) safe if you can get a wildcard to match. For example, here's how to rename What now to Whatnow, remove a$file, and rename prog|.c to prog.c:to handle this problem. One is with . Type a part of the filename without the weird characters and use a wildcard to match the rest. As article
mv What* Whatnow%
rm -i a*rm: remove a$file?
mv prog?.c prog.c
Filenames with control characters are just another version of the same problem. Use a wildcard to match the part of the name that's troubling you. The real problem with control characters with filenames is that some control characters do weird things to your screen. Once I accidentally got a file with a CTRL-L in its name. Whenever I ran ls, it erased the screen before I could see what the filename was! Article 16.14 explains that on a BSD-based UNIX system, you can use ls -q instead of a plain ls; on System V, use ls -b. It should be easy to spot the offensive file and construct a wildcard expression to rename or delete it. (ls -q is the default on many modern BSD UNIX implementations. So if you're a BSD user, you may never see this problem.)