1、ls -li (查看文件的inode号)
root@DY1100S01:[/tmp/2015-10-14]ls -li 总用量 12 1444367 -rw-r--r-- 1 root wanlong 3983 10月 14 17:00 mima 1444385 -rw-r--r-- 1 root wanlong 3983 10月 14 17:00 passwd 1444312 -rw-r--r-- 1 root wanlong 3983 10月 14 17:00 secure
2、使用find结合inode来删除文件
比如我需要删除mima的文件
root@DY1100S01:[/tmp/2015-10-14]find . -inum 1444367 -exec rm -rf {} \; root@DY1100S01:[/tmp/2015-10-14]ls -li 总用量 8 1444385 -rw-r--r-- 1 root wanlong 3983 10月 14 17:00 passwd 1444312 -rw-r--r-- 1 root wanlong 3983 10月 14 17:00 secure
说明:find . -inum 1444367 -exec rm -rf {} \;等同于find . -inum 1444367|xargs rm -rf
本文出自 “冰冻vs西瓜” 博客,请务必保留此出处http://molewan.blog.51cto.com/287340/1703103
原文:http://molewan.blog.51cto.com/287340/1703103