Redian新闻
>
how to delete a file with NULL name in unix? (转载)
avatar
how to delete a file with NULL name in unix? (转载)# Unix - 噫吁兮,危乎高哉
w*z
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?
avatar
y*o
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?

avatar
q*1
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

avatar
y*o
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 {} \;

avatar
q*1
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.

avatar
y*o
6
;-Q

【在 q**1 的大作中提到】
: that's shell wildcard, not regex. :-)
:
: enter

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。