|
UnixReview.com June 2007
Shell Corner: Littera Delenda Est (Part Two)
Hosted by Ed Schaefer
In part 2 of his healing process, Royce Williams continues his unrelenting
assault on files containing "funny characters".
Littera Delenda Est: On the Removal of Files with Unusual Characters
in Their Filenames, Part Two
by Royce Williams
In last
month's column, we learned that unusual characters in filenames fall into
some discrete categories and started to tackle the hypothetical example of a
directory full of them. The techniques already covered include escaping,
workarounds for special shell characters, and dramatic overuse of battle
metaphors. We continue in similar fashion, attacking the remaining character
types in rough order of increasing difficulty.
Falling Back to Regroup
After our
first round of skirmishes, let's see what work remains to delete these
unusual files.
We also take this opportunity to remove those files that have already served
their purpose as obstacles (so that we can better see what it is that we're
having trouble seeing). Drawing on what we've learned so far, here is how to
perform that removal, followed by a list of the survivors:
admin@unixlike$ rm -- -keeper \!keeper 0 A Z a z \~keep-me-too
admin@unixlike$ /bin/ls -lA
-rw-r----- 1 admin admin 22 May 5 2006 ?
-rw-r----- 1 admin admin 27 May 5 2006 ?
-rw-r----- 1 admin admin 20 May 5 2006 ?
-rw-r----- 1 admin admin 26 May 5 2006 ?
-rw-r----- 1 admin admin 32 May 5 2006 ?
-rw-r----- 1 admin admin 23 May 5 2006
-rw-r----- 1 admin admin 29 May 5 2006 ?
-rw-r----- 1 admin admin 29 May 5 2006
-rw-r----- 1 admin admin 21 May 5 2006 ?
Up to this point, we've been going after what we might call the "low-hanging
fruit": Those characters that have been easy to identify.
|