云计算学习路线课程大纲资料:参数传递Xargs-创新互联

今天给大家分享一些云计算学习路线课程大纲资料,这篇文章是关于参数传递 Xargs的一些学习笔记资料,希望能给大家一些帮助:

创新互联服务项目包括呼兰网站建设、呼兰网站制作、呼兰网页制作以及呼兰网络营销策划等。多年来,我们专注于互联网行业,利用自身积累的技术优势、行业经验、深度合作伙伴关系等,向广大中小型企业、政府机构等提供互联网行业的解决方案,呼兰网站推广取得了明显的社会效益与经济效益。目前,我们服务的客户以成都为中心已经辐射到呼兰省份的部分城市,未来相信会继续扩大服务区域并继续获得客户的支持与信任!

云计算学习路线课程大纲资料:参数传递 Xargs

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

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

本文标题:云计算学习路线课程大纲资料:参数传递Xargs-创新互联
URL地址:https://www.cdcxhl.com/article30/ceidso.html

成都网站建设公司_创新互联,为您提供定制网站企业建站商城网站标签优化软件开发外贸网站建设

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

外贸网站建设