熱搜:win11繞過(guò)硬件限制安裝 一鍵重裝Win10系統(tǒng) 最干凈的u盤(pán)啟動(dòng)盤(pán) 真正純凈版的win7系統(tǒng)
時(shí)間:2014-12-31 17:57:43 作者:qipeng 來(lái)源:系統(tǒng)之家 1. 掃描二維碼隨時(shí)看資訊 2. 請(qǐng)使用手機(jī)瀏覽器訪問(wèn): https://m.xitongzhijia.net/xtjc/20141231/33885.html 手機(jī)查看 評(píng)論 反饋
說(shuō)明:
使用-i參數(shù)默認(rèn)的前面輸出用{}代替,-I參數(shù)可以指定其他代替字符,如例子中的[]
實(shí)例9:xargs的-p參數(shù)的使用
命令:
代碼如下:
find 。 -name “*.log” | xargs -p -i mv {} 。。
輸出:
代碼如下:
。踨oot@localhost test3]# ll
總計(jì) 0
-rw-r--r-- 1 root root 0 11-13 06:06 log2015.log
。踨oot@localhost test3]# cd 。。
[root@localhost test]# ll
總計(jì) 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
。踨oot@localhost test]# cd test3
[root@localhost test3]# find 。 -name “*.log” | xargs -p -i mv {} 。。
mv 。/log2015.log 。。 ?。。.y
[root@localhost test3]# ll
總計(jì) 0[root@localhost test3]# cd 。。
。踨oot@localhost test]# ll
總計(jì) 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
。踨oot@localhost test]#
說(shuō)明:
-p參數(shù)會(huì)提示讓你確認(rèn)是否執(zhí)行后面的命令,y執(zhí)行,n不執(zhí)行。
上面就是Linux find命令和xargs命令組合使用的方法介紹了,find命令通過(guò)和xargs命令的配合使用,能夠解決很多實(shí)際問(wèn)題,如果你在單獨(dú)使用find命令的時(shí)候無(wú)法滿(mǎn)足你的需求,可嘗試與其他命令配合使用。
發(fā)表評(píng)論
共0條
評(píng)論就這些咯,讓大家也知道你的獨(dú)特見(jiàn)解
立即評(píng)論以上留言?xún)H代表用戶(hù)個(gè)人觀點(diǎn),不代表系統(tǒng)之家立場(chǎng)