当前位置:网站首页>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?
- 发明时代,「幂集创新」事关你我
- 二叉树的序列化和反序列化
- 超越CLIP的多模态模型,只需不到1%的训练数据!南加大最新研究来了
- We really need DApp?Really can't meet our fantasy App?
- Information system project managers must memorize the core test sites (63) The main process of project portfolio management & DIPP analysis
- 你没见过的《老友记》镜头,AI给补出来了|ECCV 2022
- AI篮球裁判火了,走步算得特别准,就问哈登慌不慌
- HAproxy: load balancing
- 放下手机吧:实验表明花20分钟思考和上网冲浪同样快乐
猜你喜欢
C# Get system installed .NET version
两分钟录音就可秒变语言通!火山语音音色复刻技术如何修炼而成?
JD.com architects tidy up: what are the core technical knowledge points of jvm and performance tuning
LeetCode热题(11.合并两个有序链表)
Here comes the question: Can I successfully apply for 8G memory on a machine with 4GB physical memory?
Flutter入门进阶之旅(三)Text Widgets
内网穿透工具ngrok使用教程
京东架构师呕心整理:jvm与性能调优有哪些核心技术知识点
又有大厂员工连续加班倒下/ 百度搜狗取消快照/ 马斯克生父不为他骄傲...今日更多新鲜事在此...
用场景定义硬件,英码科技破解“边缘计算”密码
随机推荐
阿里高工带来的20022最新面试总结太香了
FFmpeg compiles and installs on win10 (configure libx264)
无需精子卵子子宫体外培育胚胎,Cell论文作者这番话让网友们炸了
Nature:猪死亡1小时后,器官再次运转
西湖大学教授怎么看AI制药革命?|量子位智库圆桌实录
FFmpeg库在win10上配置使用(不配置libx264)
2022牛客多校(六)M. Z-Game on grid
MySQL 原理与优化,Group By 优化 技巧
又有大厂员工连续加班倒下/ 百度搜狗取消快照/ 马斯克生父不为他骄傲...今日更多新鲜事在此...
AQS Synchronization Component - FutureTask Analysis and Use Cases
数据挖掘-05
PM2 configuration file
World's 4th mad scientist dies on his 103rd birthday
How to upload local file trial version in binary mode in ABAP report
中科院打脸谷歌:普通电脑追上量子优越性,几小时搞定原本要一万年的计算...
The redis library cannot be imported
Flutter入门进阶之旅(四)文本输入Widget TextField
香港服务器如何进行加密?
自定义VIEW实现应用内消息提醒上下轮播
我们真的需要DApp吗?App真的不能满足我们的幻想吗?