find . -type f -print | xargs file
[root@localhost test]# ll 总计 312 -rw-r--r-- 1 root root 302108 11-03 06:19 log2012.log -rw-r--r-- 1 root root 0 11-12 22:25 log2013.log -rw-r--r-- 1 root root 0 11-12 22:25 log2014.log drwxr-xr-x 6 root root 4096 10-27 01:58 scf drwxrwxrwx 2 root root 4096 11-12 19:32 test3 drwxrwxrwx 2 root root 4096 11-12 19:32 test4 [root@localhost test]# find . -type f -print | xargs file ./log2014.log: empty ./log2013.log: empty ./log2012.log: ASCII text [root@localhost test]#
find / -name "core" -print | xargs echo "" >/tmp/core.log
[root@localhost test]# find / -name "core" -print | xargs echo "" >/tmp/core.log [root@localhost test]# cd /tmp [root@localhost tmp]# ll 总计 16 -rw-r--r-- 1 root root 1524 11-12 22:29 core.log drwx------ 2 root root 4096 11-12 22:24 ssh-TzcZDx1766 drwx------ 2 root root 4096 11-12 22:28 ssh-ykiRPk1815 drwx------ 2 root root 4096 11-03 07:11 vmware-root
find . -perm -7 -print | xargs chmod o-w
[root@localhost test]# ll 总计 312 -rw-r--r-- 1 root root 302108 11-03 06:19 log2012.log -rw-r--r-- 1 root root 0 11-12 22:25 log2013.log -rw-r--r-- 1 root root 0 11-12 22:25 log2014.log drwxr-xr-x 6 root root 4096 10-27 01:58 scf drwxrwxrwx 2 root root 4096 11-12 19:32 test3 drwxrwxrwx 2 root root 4096 11-12 19:32 test4 [root@localhost test]# find . -perm -7 -print | xargs chmod o-w [root@localhost test]# ll 总计 312 -rw-r--r-- 1 root root 302108 11-03 06:19 log2012.log -rw-r--r-- 1 root root 0 11-12 22:25 log2013.log -rw-r--r-- 1 root root 0 11-12 22:25 log2014.log drwxr-xr-x 6 root root 4096 10-27 01:58 scf drwxrwxr-x 2 root root 4096 11-12 19:32 test3 drwxrwxr-x 2 root root 4096 11-12 19:32 test4 [root@localhost test]#
find . -type f -print | xargs grep "hostname"
[root@localhost test]# find . -type f -print | xargs grep "hostname" ./log2013.log:hostnamebaidu=baidu.com ./log2013.log:hostnamesina=sina.com ./log2013.log:hostnames=true[root@localhost test]#
find . -name \* -type f -print | xargs grep "hostnames"
[root@peida test]# find . -name \* -type f -print | xargs grep "hostnames" ./log2013.log:hostnamesina=sina.com ./log2013.log:hostnames=true[root@localhost test]#
find . -name "*.log" | xargs -i mv {} test4
[root@localhost test]# ll
总计 316
-rw-r--r-- 1 root root 302108 11-03 06:19 log2012.log
-rw-r--r-- 1 root root 61 11-12 22:44 log2013.log
-rw-r--r-- 1 root root 0 11-12 22:25 log2014.log
drwxr-xr-x 6 root root 4096 10-27 01:58 scf
drwxrwxr-x 2 root root 4096 11-12 22:54 test3
drwxrwxr-x 2 root root 4096 11-12 19:32 test4
[root@localhost test]# cd test4/
[root@localhost test4]# ll
总计 0
[root@localhost test4]# cd ..
[root@localhost test]# find . -name "*.log" | xargs -i mv {} test4
[root@localhost test]# ll
总计 12
drwxr-xr-x 6 root root 4096 10-27 01:58 scf
drwxrwxr-x 2 root root 4096 11-13 05:50 test3
drwxrwxr-x 2 root root 4096 11-13 05:50 test4
[root@localhost test]# cd test4/
[root@localhost test4]# ll
总计 304
-rw-r--r-- 1 root root 302108 11-12 22:54 log2012.log
-rw-r--r-- 1 root root 61 11-12 22:54 log2013.log
-rw-r--r-- 1 root root 0 11-12 22:54 log2014.log
[root@localhost test4]#
find . -type f -atime +0 -print0 | xargs -0 -l1 -t rm -f
[root@pd test4]# find . -type f -atime +0 -print0 | xargs -0 -l1 -t rm -f rm -f [root@pdtest4]#
find . -name "file" | xargs -I [] cp [] ..
[root@localhost test]# ll 总计 12 drwxr-xr-x 6 root root 4096 10-27 01:58 scf drwxrwxr-x 2 root root 4096 11-13 05:50 test3 drwxrwxr-x 2 root root 4096 11-13 05:50 test4 [root@localhost test]# cd test4 [root@localhost test4]# find . -name "file" | xargs -I [] cp [] .. [root@localhost test4]# ll 总计 304 -rw-r--r-- 1 root root 302108 11-12 22:54 log2012.log -rw-r--r-- 1 root root 61 11-12 22:54 log2013.log -rw-r--r-- 1 root root 0 11-12 22:54 log2014.log [root@localhost test4]# cd .. [root@localhost test]# ll 总计 316 -rw-r--r-- 1 root root 302108 11-13 06:03 log2012.log -rw-r--r-- 1 root root 61 11-13 06:03 log2013.log -rw-r--r-- 1 root root 0 11-13 06:03 log2014.log drwxr-xr-x 6 root root 4096 10-27 01:58 scf drwxrwxr-x 2 root root 4096 11-13 05:50 test3 drwxrwxr-x 2 root root 4096 11-13 05:50 test4 [root@localhost test]#
find . -name "*.log" | xargs -p -i mv {} ..
[root@localhost test3]# ll
总计 0
-rw-r--r-- 1 root root 0 11-13 06:06 log2015.log
[root@localhost test3]# cd ..
[root@localhost test]# ll
总计 316
-rw-r--r-- 1 root root 302108 11-13 06:03 log2012.log
-rw-r--r-- 1 root root 61 11-13 06:03 log2013.log
-rw-r--r-- 1 root root 0 11-13 06:03 log2014.log
drwxr-xr-x 6 root root 4096 10-27 01:58 scf
drwxrwxr-x 2 root root 4096 11-13 06:06 test3
drwxrwxr-x 2 root root 4096 11-13 05:50 test4
[root@localhost test]# cd test3
[root@localhost test3]# find . -name "*.log" | xargs -p -i mv {} ..
mv ./log2015.log .. ?...y
[root@localhost test3]# ll
总计 0
[root@localhost test3]# cd ..
[root@localhost test]# ll
总计 316
-rw-r--r-- 1 root root 302108 11-13 06:03 log2012.log
-rw-r--r-- 1 root root 61 11-13 06:03 log2013.log
-rw-r--r-- 1 root root 0 11-13 06:03 log2014.log
-rw-r--r-- 1 root root 0 11-13 06:06 log2015.log
drwxr-xr-x 6 root root 4096 10-27 01:58 scf
drwxrwxr-x 2 root root 4096 11-13 06:08 test3
drwxrwxr-x 2 root root 4096 11-13 05:50 test4
[root@localhost test]#
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有