找到一个文件并把它删除
find -name today.py|xargs rm -rf
[root@VM-12-4-centos pa]# ll
总用量 8
drwxr-xr-x 5 root root 4096 3月 27 21:27 pa
-rw-r--r-- 1 root root 32 3月 27 10:50 test.py
-rw-r--r-- 1 root root 0 3月 29 22:09 today.py
[root@VM-12-4-centos pa]# cd ~
[root@VM-12-4-centos ~]# find -name today.py
./projects/pa/today.py
[root@VM-12-4-centos ~]#
[root@VM-12-4-centos ~]#
[root@VM-12-4-centos ~]# find -name today.py|xargs rm -rf # 移除找到的文件
[root@VM-12-4-centos ~]# cd ~/projects/pa/
[root@VM-12-4-centos pa]# ll
总用量 8
drwxr-xr-x 5 root root 4096 3月 27 21:27 pa
-rw-r--r-- 1 root root 32 3月 27 10:50 test.py
[root@VM-12-4-centos pa]#