给test2.txt做个硬链接
[root@evan-01 ~]# touch test2.txt
[root@evan-01 ~]# ll
total 16
-rw-------. 1 root root 6398 Aug 8 16:10 anaconda-ks.cfg
-rw-------. 1 root root 1257 Aug 8 18:36 anaconda-ks.cfg.bak
drwxrwxr--. 5 root evan1 105 Aug 12 10:59 test
drwxr-xr-x. 2 root root 37 Aug 12 10:59 test2
-rw-rw-r--. 1 root root 0 Aug 9 11:40 test2_heard.txt
-rw-r--r--. 1 root root 0 Aug 13 10:36 test2.txt
lrwxrwxrwx. 1 root root 9 Aug 12 11:28 test3_soft.txt -> test3.txt
-rwx------. 1 root root 15 Aug 13 10:22 test3.txt
[root@evan-01 ~]# ln test2.txt /tmp/test2.txt.bak
[root@evan-01 ~]# ls -li test2.txt
33881208 -rw-r--r--. 2 root root 0 Aug 13 10:36 test2.txt
[root@evan-01 ~]#
按inode号查找硬链接
[root@evan-01 ~]# find / -inum 33881208
/root/test2.txt
/tmp/test2.txt.bak
[root@evan-01 ~]#
mmin 按分钟查找
如果觉得查一天以内还不够具体的话,就可以按分钟查找(60分钟)
[root@evan-01 ~]# find /root/ -type f -mmin -60
/root/test3.txt
/root/test2.txt
[root@evan-01 ~]# ls -l /root/test3.txt
-rwx------. 1 root root 15 Aug 13 10:22 /root/test3.txt
[root@evan-01 ~]# ls -l /root/test2.txt
-rw-r--r--. 2 root root 0 Aug 13 10:36 /root/test2.txt
[root@evan-01 ~]# date
Tue Aug 13 10:40:38 CST 2019
按分钟查找,并且列出查到的文件的详细信息
[root@evan-01 ~]# find /root/ -type f -mmin -120 -exec ls -l {} \;
-rwx------. 1 root root 15 Aug 13 10:22 /root/test3.txt
-rw-r--r--. 2 root root 0 Aug 13 10:36 /root/test2.txt
[root@evan-01 ~]#
按分钟查找,并且批量更改文件名字
[root@evan-01 ~]# find /root/ -type f -mmin -120 -exec mv {} {}.bak \;
[root@evan-01 ~]# find /root/ -type f -mmin -120
/root/test3.txt.bak
/root/test2.txt.bak
[root@evan-01 ~]#
按文件大小查找(k/M)
[root@evan-01 ~]# find /home/ -size -10M
/home/
/home/evan1
/home/evan1/.bash_logout
/home/evan1/.bash_profile
/home/evan1/.bashrc
/home/evan1/.bash_history
/home/evan2
/home/evan2/.bash_logout
/home/evan2/.bash_profile
/home/evan2/.bashrc
/home/evan2/.bash_history
/home/shell
/home/shell/.log
/home/shell/1.sh
/home/shell/2019-08-09.log
/home/shell/1.log
[root@evan-01 ~]#
详细查看下
[root@evan-01 ~]# find /home/ -type f -size -10M -exec ls -lh {} \;
-rw-r--r--. 1 evan1 evan1 18 Aug 3 2017 /home/evan1/.bash_logout
-rw-r--r--. 1 evan1 evan1 193 Aug 3 2017 /home/evan1/.bash_profile
-rw-r--r--. 1 evan1 evan1 231 Aug 3 2017 /home/evan1/.bashrc
-rw-------. 1 evan1 evan1 352 Aug 12 10:39 /home/evan1/.bash_history
-rw-r--r--. 1 evan2 evan2 18 Aug 3 2017 /home/evan2/.bash_logout
-rw-r--r--. 1 evan2 evan2 193 Aug 3 2017 /home/evan2/.bash_profile
-rw-r--r--. 1 evan2 evan2 231 Aug 3 2017 /home/evan2/.bashrc
-rw-------. 1 evan2 evan2 257 Aug 12 10:40 /home/evan2/.bash_history
-rw-rw-r--. 1 root root 441 Aug 9 16:37 /home/shell/.log
-rw-rw-r--. 1 root root 46 Aug 9 16:38 /home/shell/1.sh
-rw-rw-r--. 1 root root 441 Aug 9 16:38 /home/shell/2019-08-09.log
-rw-r--r--. 1 root root 811 Aug 12 15:56 /home/shell/1.log
[root@evan-01 ~]#