Hi All For some reason i sometimes find files with strange names like '??'. When i do a long listing the file name changes to some other bizare character combination. When i try to delete the file using 'rm', or cat it, i can't seem to pass the correct filename to rm (i do try to escape characters, and use 'TAB' but no luck). Is there a way to pass an inode number to rm or cat? thanks, --brad
On Fri, May 24, 2002 at 11:00:22AM -0400, Brad Noyes wrote:
For some reason i sometimes find files with strange names like '??'. When i do a long listing the file name changes to some other bizare character combination. When i try to delete the file using 'rm', or cat it, i can't seem to pass the correct filename to rm (i do try to escape characters, and use 'TAB' but no luck). Is there a way to pass an inode number to rm or cat?
Try "ls -b". It will show you octal codes for non-printable chars, and escape things like spaces, etc. You should be able to cut/paste that to rm. -- Randomly Generated Tagline: In most countries selling harmful things like drugs is punishable. Then howcome people can sell Microsoft software and go unpunished? (By hasku@rost.abo.fi, Hasse Skrifvars)
On Fri, May 24, 2002 at 11:00:22AM -0400, Brad Noyes wrote: maitre> combination. When i try to delete the file using 'rm', or cat it, i can't seem to maitre> pass the correct filename to rm (i do try to escape characters, and use 'TAB' but no luck). Is there a way to pass an inode number to rm or cat? Go to the directory that contains these strange filenames and do: rm -i * Then type y when you get to the strange file(s) you want to delete. -- Charles R. Anderson <cra@wpi.edu> / http://angus.ind.wpi.edu/~cra/ PGP Key ID: 49BB5886 Fingerprint: EBA3 A106 7C93 FA07 8E15 3AC2 C367 A0F9 49BB 5886
If you want you can also open up midnight commander, just delete it that way. I had the same problem with a file named '-s' -Joe Charles R. Anderson wrote:
On Fri, May 24, 2002 at 11:00:22AM -0400, Brad Noyes wrote: maitre> combination. When i try to delete the file using 'rm', or cat it, i can't seem to maitre> pass the correct filename to rm (i do try to escape characters, and use 'TAB' but no luck). Is there a way to pass an inode number to rm or cat?
Go to the directory that contains these strange filenames and do:
rm -i *
Then type y when you get to the strange file(s) you want to delete.
On Sat, 25 May 2002, Joe Riopel wrote: JR> If you want you can also open up midnight commander, just delete it JR> that way. I had the same problem with a file named '-s' for files that start with a "-" character, to remove them you include a "--" before the file name. for your example: rm -- -s I had to move and delete a bunch of files that were named with a "-" at the beginning... Lots of graphics for a report for one of my math classes... -- --==*==-- --==*==-- Michelle R. Vadeboncoeur --==*==-- --==*==-- mrv@kluge.net: http://www.kluge.net/~mrv/
or just do what i do, rm ./--file_name -mike ----- Original Message ----- From: "Michelle Vadeboncoeur" <mrv@kluge.net> To: <wlug@mail.wlug.org> Sent: Saturday, May 25, 2002 11:55 Subject: Re: [Wlug] strange filenames
On Sat, 25 May 2002, Joe Riopel wrote:
JR> If you want you can also open up midnight commander, just delete it JR> that way. I had the same problem with a file named '-s'
for files that start with a "-" character, to remove them you include a "--" before the file name.
for your example: rm -- -s
I had to move and delete a bunch of files that were named with a "-" at the beginning... Lots of graphics for a report for one of my math classes...
-- --==*==-- --==*==-- Michelle R. Vadeboncoeur --==*==-- --==*==-- mrv@kluge.net: http://www.kluge.net/~mrv/
_______________________________________________ Wlug mailing list Wlug@mail.wlug.org http://mail.wlug.org/mailman/listinfo/wlug
Charles R. Anderson wrote:
On Fri, May 24, 2002 at 11:00:22AM -0400, Brad Noyes wrote: maitre> combination. When i try to delete the file using 'rm', or cat it, i can't seem to maitre> pass the correct filename to rm (i do try to escape characters, and use 'TAB' but no luck). Is there a way to pass an inode number to rm or cat?
Go to the directory that contains these strange filenames and do:
rm -i *
Then type y when you get to the strange file(s) you want to delete.
you could also try removing the files by inode.
On Sat, May 25, 2002 at 01:43:23PM -0400, Bryan Scaringe wrote: scaringe> you could also try removing the files by inode. Like this I suppose: # shows the inode numbers for each file in the directory ls -i # removes inode number N find . -inum N -exec rm {} \; -- Charles R. Anderson <cra@wpi.edu> / http://angus.ind.wpi.edu/~cra/ PGP Key ID: 49BB5886 Fingerprint: EBA3 A106 7C93 FA07 8E15 3AC2 C367 A0F9 49BB 5886
Thanks everyone! All these ideas are great and i probably wouldn't have though of them on my own. Thanks again, --brad
Just one more thought: Files with goofy names might be indicative of a screwed-up file system. It may not be a bad idea to run fsck before you go deleting any of those strange files.
participants (7)
-
Brad Noyes
-
Bryan Scaringe
-
Charles R. Anderson
-
Joe Riopel
-
Michael Frysinger
-
Michelle Vadeboncoeur
-
Theo Van Dinter