Re: Can't Delete File with Bad Chars
On Thu, 10 Dec 2009 17:04:03 -0600
Kent West <westk@acu.edu> wrote:
> I've got a TeraStation Pro Network Attached Storage device connected
> to a stable Debian box. I'm trying to free up some space by deleting
> old backups, but have come across a file with a bad name. I'm
> smbmounting the NAS to get to the file structure; I'm not real sure
> how the NAS drives are formatted.
>
> When I run "stat [tab key to autocomplete the name]" I get a different
> node number often.
>
> westk[@]goshen.acu.edu]:/TERASTATIONBACKUP/RSYNC-BACKUP/home/web/html/mriggs/Archive/Spring
> 2008/445:> stat Tentative\ Schedule\ \?��\ Math\ 445.pdf
> File: `Tentative Schedule ?\307\364 Math 445.pdf'
> Size: 49699 Blocks: 104 IO Block: 16384 regular file
> Device: 11h/17d Inode: 59670244 Links: 1
> Access: (0766/-rwxrw-rw-) Uid: ( 101/ sshd) Gid: ( 100/
> users) Access: 2009-02-20 13:57:10.000000000 -0600
> Modify: 2008-01-23 09:29:06.000000000 -0600
> Change: 2009-02-20 13:57:08.000000000 -0600
>
> westk[@]goshen.acu.edu]:/TERASTATIONBACKUP/RSYNC-BACKUP/home/web/html/mriggs/Archive/Spring
> 2008/445:> stat Tentative\ Schedule\ \?��\ Math\ 445.pdf
> stat: cannot stat `Tentative Schedule ?\307\364 Math 445.pdf': No such
> file or directory
>
> (The second attempt was just to recall my history with the up arrow; I
> have to fill in the stat command with the TAB key to get any data.)
>
> Then I tried to delete the file with some magic I found via Google:
>
>
> westk[@]goshen.acu.edu]:/TERASTATIONBACKUP/RSYNC-BACKUP/home/web/html/mriggs/Archive/Spring
> 2008/445:> find . -inum 59670414 -exec rm -i {} \;
> rm: remove regular file `./Tentative Schedule ?\307\364 Math
> 445.pdf'? y rm: cannot remove `./Tentative Schedule ?\307\364 Math
> 445.pdf': No such file or directory
>
> Then I try the stat command again, and find the inode number has
> changed:
>
> westk[@]goshen.acu.edu]:/TERASTATIONBACKUP/RSYNC-BACKUP/home/web/html/mriggs/Archive/Spring
> 2008/445:> stat Tentative\ Schedule\ \?��\ Math\ 445.pdf
> File: `Tentative Schedule ?\307\364 Math 445.pdf'
> Size: 49699 Blocks: 104 IO Block: 16384 regular file
> Device: 11h/17d Inode: 59670677 Links:
> 1/TERASTATIONBACKUP/RSYNC-BACKUP/home/web/html/mriggs/Archive/Spring
> Access: (0766/-rwxrw-rw-) Uid: ( 101/ sshd) Gid: ( 100/
> users) Access: 2009-02-20 13:57:10.000000000 -0600 Modify: 2008-01-23
> 09:29:06.000000000 -0600Change: 2009-02-20 13:57:08.000000000 -0600
>
>
> Any suggestions as to how I can delete this file?
>
> Thanks!
>
>
Use quotes? Something like...
"/TERASTATIONBACKUP/RSYNC-BACKUP/home/web/html/mriggs/Archive/Spring....."
--
Best regards,
Chris
“It is always better to have no ideas than false ones; to believe
nothing, than to believe what is wrong.”
-- Thomas Jefferson
Reply to: