第一步:获取文件的id号
ls -li
第二步:执行删除
find . -inum 32983551 -exec rm {} ;
二、重命名
find . -inum 32983542 -exec mv {} test.php ;
实际操作:
[root@10-57-22-49 ~]# ll -li
total 572
135222423 -rw-r--r-- 1 root root 29669 Feb 5 00:20 172.16.200.6.xml
136291993 -rw-------. 1 root root 1170 Jul 26 2017 anaconda-ks.cfg
270165512 drwxr-xr-x 3 root root 17 Dec 22 01:22 ansible-ce
136337934 -rw-r--r-- 1 root root 31918 Jan 18 01:22 ansible.log
136384689 drwxr-xr-x 9 root root 4096 Jun 13 2017 CloudEngine-Ansible-0.2.0
136384688 -rw-r--r-- 1 root root 504942 Dec 20 22:43 CloudEngine-Ansible-0.2.0.zip
135222400 -rw-r--r-- 1 root root 0 Mar 7 22:36 d?J9??XN{
136337969 -rw-r--r-- 1 root root 322 Feb 5 00:20 test.py
[root@10-57-22-49 ~]# find . -inum 135222400 -exec rm {} \;
[root@10-57-22-49 ~]# ll
total 572
-rw-r--r-- 1 root root 29669 Feb 5 00:20 172.16.200.6.xml
-rw-------. 1 root root 1170 Jul 26 2017 anaconda-ks.cfg
drwxr-xr-x 3 root root 17 Dec 22 01:22 ansible-ce
-rw-r--r-- 1 root root 31918 Jan 18 01:22 ansible.log
drwxr-xr-x 9 root root 4096 Jun 13 2017 CloudEngine-Ansible-0.2.0
-rw-r--r-- 1 root root 504942 Dec 20 22:43 CloudEngine-Ansible-0.2.0.zip
-rw-r--r-- 1 root root 322 Feb 5 00:20 test.py
网友评论