mirror of
https://github.com/onceupon/Bash-Oneliner.git
synced 2024-11-29 15:46:35 +00:00
add grep and xargs
This commit is contained in:
parent
b7b1a844ff
commit
6b7d0d3edb
11
README.md
11
README.md
@ -89,6 +89,11 @@ or
|
|||||||
```bash
|
```bash
|
||||||
grep -rh bbo /path/to/directory
|
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)
|
##### 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
|
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
|
## Find
|
||||||
[[back to top](#handy-bash-oneliner-commands-for-tsv-file-editing)]
|
[[back to top](#handy-bash-oneliner-commands-for-tsv-file-editing)]
|
||||||
##### List all sub directory/file in the current directory
|
##### List all sub directory/file in the current directory
|
||||||
|
Loading…
Reference in New Issue
Block a user