当前位置:网站首页>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目录下,所有用户都有执行权限,且其它用户有写权限的文件
边栏推荐
- 鹅厂机器狗花式穿越10m梅花桩:前空翻、单桩跳、起身作揖...全程不打一个趔趄...
- Flutter入门进阶之旅(七)GestureDetector
- The batch size does not have to be a power of 2!The latest conclusions of senior ML scholars
- Manchester city launch emotional intelligence scarf can be detected, give the fans
- Byte Qiu Zhao confused me on both sides, and asked me under what circumstances would the SYN message be discarded?
- 【小程序】低代码+小游戏=小游戏可视化开发
- Nature:猪死亡1小时后,器官再次运转
- 数字化转型之支撑保障单元
- K个结点的组内逆序调整
- 使用RecyclerView实现三级折叠列表
猜你喜欢
智驾科技完成C1轮融资,此前2轮已融4.5亿元
Flutter入门进阶之旅(六)Layout Widget
How to upload local file trial version in binary mode in ABAP report
Too much volume... Tencent was asked on the side that the memory was full, what would happen?
#Internet of Things essay#Xiaoxiong pie equipment development actual combat
900页数学论文证明旋转的黑洞不会爆炸,丘成桐:30多年来广义相对论首次重大突破...
Go 事,如何成为一个Gopher ,并在7天找到 Go 语言相关工作,第1篇
读写分离后,性能居然提升100%了呀
Reading and writing after separation, performance were up 100%
Compensation transaction and idempotency guarantee based on CAP components
随机推荐
【无标题】
C# Get system installed .NET version
国产抗新冠口服药每瓶不超300元/ 我国IPv6网络全面建成/ 谷歌入局折叠屏手机...今日更多新鲜事在此...
基于CAP组件实现补偿事务与幂等性保障
MongoDB-查询中$all的用法介绍
用场景定义硬件,英码科技破解“边缘计算”密码
FFmpeg compiles and installs on win10 (configure libx264)
Information system project managers must memorize the core test sites (63) The main process of project portfolio management & DIPP analysis
HAproxy:负载均衡
十分钟教会你如何使用VitePress搭建及部署个人博客站点
在北极都可以穿短袖了,温度飙升至32.5℃
API调用,API传参,面向对接开发,你真的会写接口文档吗?
go基础之web获取参数
The batch size does not have to be a power of 2!The latest conclusions of senior ML scholars
We really need DApp?Really can't meet our fantasy App?
【Untitled】
Scala Advanced (7): Collection Content Summary (Part 1)
26、管道参数替换命令xargs
[Interview high-frequency questions] Linked list high-frequency questions that can be gradually optimized
又有大厂员工连续加班倒下/ 百度搜狗取消快照/ 马斯克生父不为他骄傲...今日更多新鲜事在此...