当前位置:网站首页>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目录下,所有用户都有执行权限,且其它用户有写权限的文件
边栏推荐
- Resolved IndentationError: unindent does not match any oute r indentation Level
- Rust从入门到精通04-数据类型
- Common gadgets of Shell (sort, uniq, tr, cut)
- 箭头函数和普通函数的常见区别
- 系统提供的堆 VS 手动改写堆
- 二叉树的序列化和反序列化
- 两分钟录音就可秒变语言通!火山语音音色复刻技术如何修炼而成?
- How should the acceptance criteria for R&D requirements be written?| Agile Practices
- The batch size does not have to be a power of 2!The latest conclusions of senior ML scholars
- 你没见过的《老友记》镜头,AI给补出来了|ECCV 2022
猜你喜欢
Byte Qiu Zhao confused me on both sides, and asked me under what circumstances would the SYN message be discarded?
Too much volume... Tencent was asked on the side that the memory was full, what would happen?
h264协议
Blocking, non-blocking, multiplexing, synchronous, asynchronous, BIO, NIO, AIO all in one pot
8、IDEA提交代码出现: Fetch failed fatal: Could not read from remote repository
听声辨物,这是AI视觉该干的???|ECCV 2022
How should the acceptance criteria for R&D requirements be written?| Agile Practices
AI篮球裁判火了,走步算得特别准,就问哈登慌不慌
API调用,API传参,面向对接开发,你真的会写接口文档吗?
【HCIP持续更新】IS-IS协议原理与配置
随机推荐
Reading and writing after separation, performance were up 100%
Report: The number of students who want to learn AI has increased by 200%, and there are not enough teachers
Scala 高阶(七):集合内容汇总(上篇)
1小时直播招募令:行业大咖干货分享,企业报名开启丨量子位·视点
How to upload local file trial version in binary mode in ABAP report
How should the acceptance criteria for R&D requirements be written?| Agile Practices
Adalvo acquires its first branded product, Onsolis
保存Simulink仿真模型为图片或者PDF的方法
Apexsqlrecover无法连接数据库
非科班AI小哥火了:他没有ML学位,却拿到DeepMind的offer
2022牛客多校(六)M. Z-Game on grid
自定义VIEW实现应用内消息提醒上下轮播
Fragment中嵌套ViewPager数据空白页异常问题分析
Say goodbye to the AI era of hand looms
MySQL查询性能优化七种武器之索引潜水
鹅厂机器狗花式穿越10m梅花桩:前空翻、单桩跳、起身作揖...全程不打一个趔趄...
The FFmpeg library is configured and used on win10 (libx264 is not configured)
The batch size does not have to be a power of 2!The latest conclusions of senior ML scholars
goalng-sync/atomic原子操作
在北极都可以穿短袖了,温度飙升至32.5℃