当前位置:网站首页>26. Pipeline parameter substitution command xargs
26. Pipeline parameter substitution command xargs
2022-08-09 13:16:00 【51CTO】
Use is mentioned abovelocate命令及find命令查找文件,本文主要介绍xargsFunctions and command options;
1、备份配置文件,并添加bak这个扩展名
xargs The command is to readStandard input and data from pipesIt is used as an argument to other commands to make up for the lack of some commands that do not support piped data input,Generally used for pipes;如下所示:
xargs选项:
-d 分隔符 :Think by defaultxargs使用空白、tab、The carriage return is passed to the following command as a parameter separator,可以使用-d指定分隔符
-p 交互式命令
-n 表示将xargs生成的命令行参数,Pass several at a time to subsequent executions
-0 表示以\0as a sub-payment,一般用于find命令,Cannot be used due to file namingNUM字符串,使用-0,Argument separation errors can be avoided
使用方式 find . -name "*.txt" -print0 | xargs -0 echo (-print0 Indicates that it is added after the result of the search\0而不是换行符)
-i 或者是-I,这得看linux支持了,将xargs的每项名称,一般是一行一行赋值给 {},可以用 {} 代替
-P 修改最大的进程数,默认是1,为0时候为as many as it can
练习:
1、查找/var下属主为root and the owner ismail的所有文件
2、查找/var目录下不属于root、lp、gdm的所有文件
3、查找/varThe directory has been modified in the last week,同时属主不为root 也不是postfix的文件
4、查找当前系统上没有属主或属组,且最近一个周内曾被访问过的文件
5、Find greater than1M且类型为普通文件的所有文件
6、查找/etc目录下所有用户都没有写权限的文件
7、查找/etc目录下至少有一类用户没有执行权限的文件
8、查找/etc/init.d目录下,所有用户都有执行权限,且其它用户有写权限的文件
边栏推荐
- Too much volume... Tencent was asked on the side that the memory was full, what would happen?
- 金融业“限薪令”出台/ 软银出售过半阿里持仓/ DeepMind新实验室成立... 今日更多新鲜事在此...
- Flutter入门进阶之旅(六)Layout Widget
- MySQL5.6到8.0的账号迁移
- ABP 6.0.0-rc.1的新特性
- 告别手摇织布机的AI时代
- Flutter入门进阶之旅(七)GestureDetector
- 智驾科技完成C1轮融资,此前2轮已融4.5亿元
- 腾讯欲成育碧最大股东/ 米哈游招NLP内容生成研究员/ AI发现四千余物种濒临灭绝...今日更多新鲜事在此...
- 读写分离后,性能居然提升100%了呀
猜你喜欢
How should the acceptance criteria for R&D requirements be written?| Agile Practices
罗振宇折戟创业板/ B站回应HR称用户是Loser/ 腾讯罗技年内合推云游戏掌机...今日更多新鲜事在此...
LeetCode热题(11.合并两个有序链表)
Common gadgets of Shell (sort, uniq, tr, cut)
用 API Factory 产品生成 API 文档
问题来了:4GB物理内存的机器上申请8G内存能成功吗?
Byte Qiu Zhao confused me on both sides, and asked me under what circumstances would the SYN message be discarded?
HAproxy: load balancing
#物联网征文#小熊派设备开发实战
Report: The number of students who want to learn AI has increased by 200%, and there are not enough teachers
随机推荐
注释、关键字、标识符的区别你知道吗?
Glory to the Blue Yonder, speeds up the strategic growth
Flutter入门进阶之旅(一)-初识Flutter
Flutter入门进阶之旅(三)Text Widgets
WeChat Mini Program Payment and Refund Overall Process
虚拟机安装出现的问题汇总
Gumbel_Softmax 概要
中科院打脸谷歌:普通电脑追上量子优越性,几小时搞定原本要一万年的计算...
【Untitled】
redis库没法引入
ABAP 面试题:如何使用 ABAP 编程语言的 System CALL 接口,直接执行 ABAP 服务器所在操作系统的 shell 命令?
腾讯欲成育碧最大股东/ 米哈游招NLP内容生成研究员/ AI发现四千余物种濒临灭绝...今日更多新鲜事在此...
ABAP interview questions: how to use the System CALL interface of the ABAP programming language, direct execution ABAP server operating System's shell command?
李开复花上千万投的缝纫机器人,团队出自大疆
使用RecyclerView实现三级折叠列表
Batch大小不一定是2的n次幂!ML资深学者最新结论
Simple understanding of ThreadLocal
大佬们,请教一下,我看官方文档中,sqlserver cdc只支持2012版之后的,对于sqlser
两分钟录音就可秒变语言通!火山语音音色复刻技术如何修炼而成?
LeetCode #101. Symmetric Binary Tree