mirror of
https://github.com/onceupon/Bash-Oneliner.git
synced 2024-11-22 21:07:00 +00:00
add awk, sed and system
This commit is contained in:
parent
cd51d75f29
commit
81bc838790
21
README.md
21
README.md
@ -273,6 +273,11 @@ sed ':a;N;$!ba;s/\n//g'
|
|||||||
sed -n '10,33p' <filename
|
sed -n '10,33p' <filename
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#####change delimiter
|
||||||
|
```bash
|
||||||
|
sed 's=/=\\/=g'
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
#Awk
|
#Awk
|
||||||
[[back to top](#handy-bash-oneliner-commands-for-tsv-file-editing)]
|
[[back to top](#handy-bash-oneliner-commands-for-tsv-file-editing)]
|
||||||
@ -443,6 +448,18 @@ detail here: http://stackoverflow.com/questions/33408762/bash-turning-single-c
|
|||||||
awk '{split($2,a,",");for(i in a)print $1"\t"a[i]}' file
|
awk '{split($2,a,",");for(i in a)print $1"\t"a[i]}' file
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#####sum up a file
|
||||||
|
|
||||||
|
```bash
|
||||||
|
awk '{s+=$1} END {print s}' filename
|
||||||
|
```
|
||||||
|
|
||||||
|
#####print field start with string (e.g Linux)
|
||||||
|
```bash
|
||||||
|
awk '$1 ~ /^Linux/'
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
##Xargs
|
##Xargs
|
||||||
[[back to top](#handy-bash-oneliner-commands-for-tsv-file-editing)]
|
[[back to top](#handy-bash-oneliner-commands-for-tsv-file-editing)]
|
||||||
@ -1540,6 +1557,10 @@ cat /proc/sys/kernal/pid_max
|
|||||||
```bash
|
```bash
|
||||||
ulimit -u
|
ulimit -u
|
||||||
```
|
```
|
||||||
|
#####which ports are listening for TCP connections from the network
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nmap -sT -O localhost
|
||||||
|
```
|
||||||
|
|
||||||
=-=-=-=-=-A lot more coming!! =-=-=-=-=-=-=-=-=-=waitwait-=-=-=-=-=-=-=-=-=-
|
=-=-=-=-=-A lot more coming!! =-=-=-=-=-=-=-=-=-=waitwait-=-=-=-=-=-=-=-=-=-
|
||||||
|
Loading…
Reference in New Issue
Block a user