免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
云計(jì)算學(xué)習(xí)路線課程大綱資料:參數(shù)傳遞 Xargs

今天給大家分享一些云計(jì)算學(xué)習(xí)路線課程大綱資料,這篇文章是關(guān)于參數(shù)傳遞 Xargs的一些學(xué)習(xí)筆記資料,希望能給大家一些幫助:

====================================================================================

awk sed grep sort uniq less more xargs

xargs: ls cp rm

案例1

[root@localhost ~]# touch /home/file{1..5}

[root@localhost ~]# vim files.txt

/home/file1

/home/file2

/home/file3

/home/file4

/home/file5

[root@localhost ~]# cat files.txt |ls -l

[root@localhost ~]# cat files.txt |rm -rvf

cont.

[root@localhost ~]# cat files.txt |xargs ls -l

-rw-r--r--. 1 root root 0 Mar 11 10:35 /home/file1

-rw-r--r--. 1 root root 0 Mar 11 10:35 /home/file2

-rw-r--r--. 1 root root 0 Mar 11 10:35 /home/file4

-rw-r--r--. 1 root root 0 Mar 11 10:35 /home/file5

[root@localhost ~]# cat files.txt |xargs rm -rvf

removed ‘/home/file1’

removed ‘/home/file2’

removed ‘/home/file4’

removed ‘/home/file5’

案例2

[root@localhost ~]# touch /home/file{1..5}

[root@localhost ~]# cat files.txt |xargs -I {} ls -l {}

-rw-r--r--. 1 root root 0 Mar 11 10:40 /home/file1

-rw-r--r--. 1 root root 0 Mar 11 10:40 /home/file2

-rw-r--r--. 1 root root 0 Mar 11 10:40 /home/file4

-rw-r--r--. 1 root root 0 Mar 11 10:40 /home/file5

[root@localhost ~]# cat files.txt |xargs -I {} cp -rvf {} /tmp

‘/home/file1’ -> ‘/tmp/file1’

‘/home/file2’ -> ‘/tmp/file2’

‘/home/file4’ -> ‘/tmp/file4’

‘/home/file5’ -> ‘/tmp/file5’

[root@localhost ~]# cat files.txt |xargs -I YANG cp -rvf YANG /var/tmp

‘/home/file1’ -> ‘/var/tmp/file1’

‘/home/file2’ -> ‘/var/tmp/file2’

‘/home/file4’ -> ‘/var/tmp/file4’

‘/home/file5’ -> ‘/var/tmp/file5’

案例3

[root@localhost ~]# find /etc -iname "*ifcfg*" |xargs -I {} cp -rf {} /tmp

本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
管道及 I/O 重定向
MYSQL解決select ... into outfile '..' mysql寫(xiě)文件權(quán)限問(wèn)題 Can't create/write to file
find命令中的print0和xargs
Linux shell 提取文件名和目錄名 復(fù)制文件名
一篇文章學(xué)會(huì)數(shù)據(jù)備份利器rsync
15+ 個(gè) tar 命令的用法,附示例
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服