|
Home > Archive > Unix questions > October 2004 > How to remove file with empty filename ?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
How to remove file with empty filename ?
|
|
|
| in normal ls-command shows only empty filename ?
ls -b shows filename /177/177/177/177/177/177
how can I remove this file ?
janne
| |
| Bit Twister 2004-10-27, 5:52 pm |
| On Thu, 28 Oct 2004 01:26:01 +0300, jn wrote:
> in normal ls-command shows only empty filename ?
>
>
> ls -b shows filename /177/177/177/177/177/177
>
> how can I remove this file ?
Two methods jump to mind.
You could do a rm interactive with a wild card. No for all files and y
for empty name.
Copy all other files to another directory and rm -r /dir/with/empty_name_here
| |
| Artur Shnayder 2004-10-27, 8:46 pm |
| 1. cd to the directory
2. run "ls -li" and figure out what the inode number is.
3. run "find . -inum $inode -print -exec rm -f {} \;"
replace $inode with real inode number.
"jn" <jniemisto@hotmail.com> wrote in message
news:%fVfd.29$KJ4.22@reader1.news.jippii.net...
> in normal ls-command shows only empty filename ?
>
>
> ls -b shows filename /177/177/177/177/177/177
>
> how can I remove this file ?
>
> janne
>
>
| |
| Stephane CHAZELAS 2004-10-28, 2:48 am |
| 2004-10-28, 01:26(+03), jn:
> in normal ls-command shows only empty filename ?
>
>
> ls -b shows filename /177/177/177/177/177/177
>
> how can I remove this file ?
rm "`printf %b '\0177\0177\0177\0177\0177\0177'`"
With shells with a menu completion activated (tcsh, zsh, bash
even though not all would work correctly with unprintable
characters).
Type rm -- <Tab> and navigate in the list of choices until you
select the right one.
With zsh, ksh93, bash:
rm $'\177\177\177\177\177\177'
--
Stephane
|
|
|
|
|