当前位置:网站首页>[shell] Reprint: batch replacement find awk sed xargs
[shell] Reprint: batch replacement find awk sed xargs
2022-07-26 19:49:00 【Better go against the wind than wait for the wind to come】
Find before replace
find / -name ini.txt|xargs sed -i 's/123/456/g'
Replace the same character in multiple files
When writing code, we often encounter the problem of .c and .h Some of the contents of the file are completely replaced , use sourceinsight Global search is a way , however sourceinsight You can only replace strings in one file , You cannot replace the same character in multiple files at the same time , stay linux Next Use find, combination sed,xargs This function can be realized .
Put... In the current directory all .c and .h In file Of "waf" character All Replace with “tamper”
find . -name "*.[ch]" |xargs sed -i 's/waf/tamper/g'
- hold 、/opt/test/ All under the directory contain "linux" Replace all character files with windows
The order is as follows
find /opt/test/ -type f | awk -F":" '{print $1}' |xargs sed -i's/linux/windows/g'
边栏推荐
猜你喜欢

YOLO V2详解

How to adjust the abnormal win11 USB drive to normal?

LeetCode每日一练 —— 189. 轮转数组

Implementing DDD based on ABP -- domain logic and application logic

ipad下载的文件在哪里可以找到

2022/07/26 学习笔记 (day16) 链表和栈

MySQL tutorial: MySQL database learning classic (from getting started to mastering)

Where can I find the files downloaded from iPad

Principle analysis and source code interpretation of service discovery

Leetcode-138-copy linked list with random pointer
随机推荐
2022/07/26 learning notes (day16) abstraction and interface
EN 1504-7 products for protection and repair of concrete structures corrosion prevention of reinforcement - CE certification
How to write the test case of mobile app? What are the mobile app test points?
YOLO V2详解
Server memory failure prediction can actually do this
Win11 U盘驱动异常怎么调整为正常?
Thinking personally
线性代数第3章向量
Live video source code to achieve the advertising effect of scrolling up and down
Spatiotemporal prediction 4-graph WaveNet
带你熟悉云网络的“电话簿”:DNS
eadiness probe failed: calico/node is not ready: BIRD is not ready: Error querying BIRD: unable to c
视频直播源码,实现上下滚动的广告效果
首席信息官引导业务变革的指南
服务发现原理分析与源码解读
Deeply analyze the execution process of worker threads in the thread pool through the source code
Intensive reading of the paper: yolov2 - yolo9000: better, faster, stronger
查看容器的几种方式
MySQL tutorial: MySQL database learning classic (from getting started to mastering)
J1: why is redis so fast + basic structure