2
I recently unpacked a set of backup files in RHEL3 - 2.4kernel with tar via:
tar -xvf backupfile
It started to error out a bunch and I aborted thinking that maybe it was a gzip instead. Unpacking via:
tar -zxvf backupfile
Worked fine but now I have a handful of files that are highlighted red with crazy random names. I am unable to delete them using rm -f
. Is there any thing else I can do? I'm root, they are owned by root/root. Any help is greatly appreciated! Thanks.
What do you mean by "I am unable to delete them using
rm -f
."? Is it that you're unable to type the filenames, because they're "crazy" and "random"? Or are you successfully typing the names, butrm
is giving you an error message? If the latter, what is the error message? – G-Man Says 'Reinstate Monica' – 2014-10-20T23:04:12.333Sorry, I should have been more clear. I've input "rm -f filename" after pressing enter, rm completes as if successful. When I check the directory, the file remains. – Chris N – 2014-10-20T23:14:27.983
Part of the meaning of the
-f
flag torm
is "ignore nonexistent files". For example, if you were to type something likerm -f the_quick_brown_fox_jumps_over_the_lazy_dog
, you'll get a shell prompt (with no error message), but nothing will happen (unless you happen to have a file by that name). I suspect that the file names have invisible control characters, and so you're just not typing them accurately. One quick way to check this would be to type therm
commands without-f
. – G-Man Says 'Reinstate Monica' – 2014-10-20T23:19:40.053Ok, this makes sense so for instance when I type the full filename of a file that does not have control characters(I wouldn't know how to type those anyway), I get a command prompt (>) after: rm -f ?=?e??}1?21?t?Q?????G4b&?V???n??ZX?4h"??cPD?3Dja%?F?B??HY+?????????g??[`?????}??O???_?^?????.&?T
please excuse my syntax errors and thanks for trying to help. How can I delete a file with such a long name, I tried "*" to no avail. – Chris N – 2014-10-20T23:28:48.497
Update: Typing rm without -f gives me a sub-prompt (>) and nothing else. rm ?=?e??}1?21?t?Q?????G4b&?V???n??ZX?4h"??cPD?3Dja%?F?B??HY+?????????g??[`?????}??O???_?^?????.&?T then one line below > – Chris N – 2014-10-20T23:46:45.263
By the way, it looks like what you’re describing is that you’re typing a filename with an unbalanced quote. The shell interprets that as an incomplete command, and issues the
>
prompt until you finish the command by typing the matching quote. – G-Man Says 'Reinstate Monica' – 2014-10-21T00:07:37.763