mirror of
https://github.com/onceupon/Bash-Oneliner.git
synced 2024-12-23 08:46:36 +00:00
add grep and xargs
This commit is contained in:
parent
b7b1a844ff
commit
6b7d0d3edb
11
README.md
11
README.md
@ -88,8 +88,13 @@ grep -Rh bbo /path/to/directory
|
||||
or
|
||||
```bash
|
||||
grep -rh bbo /path/to/directory
|
||||
```
|
||||
or only list filename with match
|
||||
```bash
|
||||
grep -rl bbo /path/to/directory
|
||||
```
|
||||
|
||||
|
||||
##### Grep OR (e.g. A or B or C or D)
|
||||
|
||||
```
|
||||
@ -662,6 +667,12 @@ ls|xargs wc -l
|
||||
cat grep_list |xargs -I{} grep {} filename
|
||||
```
|
||||
|
||||
##### Xargs and sed (replace all old ip address with new ip address under /etc directory)
|
||||
```bash
|
||||
grep -rl '192.168.1.111' /etc | xargs sed -i 's/192.168.1.111/192.168.2.111/g'
|
||||
```
|
||||
|
||||
|
||||
## Find
|
||||
[[back to top](#handy-bash-oneliner-commands-for-tsv-file-editing)]
|
||||
##### List all sub directory/file in the current directory
|
||||
|
Loading…
Reference in New Issue
Block a user