w***z 发帖数: 1848 | 1 【 以下文字转载自 Linux 讨论区 】
发信人: windz (风子), 信区: Linux
标 题: how to delete a file with NULL name in unix?
发信站: BBS 未名空间站 (Tue May 8 12:08:36 2007)
I accidentally create a file with null name in unix. if I do "ls -l", I can
see the entry but cannot see the file name. How can I delete it? |
y********o 发帖数: 2565 | 2 Maybe it can help if you use regex after rm.
can
【在 w***z 的大作中提到】 : 【 以下文字转载自 Linux 讨论区 】 : 发信人: windz (风子), 信区: Linux : 标 题: how to delete a file with NULL name in unix? : 发信站: BBS 未名空间站 (Tue May 8 12:08:36 2007) : I accidentally create a file with null name in unix. if I do "ls -l", I can : see the entry but cannot see the file name. How can I delete it?
|
q**1 发帖数: 193 | 3 rm does not suppport regex
i think this had been answered somewhere else. the safest
way is use 'inode'
find inode of the file(assume it's ###):
ls -i
remove with find
find -inum ### -exec rm -f {} \;
【在 y********o 的大作中提到】 : Maybe it can help if you use regex after rm. : : can
|
y********o 发帖数: 2565 | 4 O, I was suggesting that he could probably do something like rm * and enter
Y or N to selectively remove files he wanted to discard.
【在 q**1 的大作中提到】 : rm does not suppport regex : i think this had been answered somewhere else. the safest : way is use 'inode' : find inode of the file(assume it's ###): : ls -i : remove with find : find -inum ### -exec rm -f {} \;
|
q**1 发帖数: 193 | 5 that's shell wildcard, not regex. :-)
enter
【在 y********o 的大作中提到】 : O, I was suggesting that he could probably do something like rm * and enter : Y or N to selectively remove files he wanted to discard.
|
y********o 发帖数: 2565 | 6 ;-Q
【在 q**1 的大作中提到】 : that's shell wildcard, not regex. :-) : : enter
|