mirror of
https://github.com/onceupon/Bash-Oneliner.git
synced 2024-12-24 01:06:36 +00:00
Update README.md
This commit is contained in:
parent
743db35c52
commit
71493924ad
25
README.md
25
README.md
@ -419,21 +419,14 @@ fileB 5 2 e
|
|||||||
e.g.
|
e.g.
|
||||||
fileA:
|
fileA:
|
||||||
1 0
|
1 0
|
||||||
|
|
||||||
2 1
|
2 1
|
||||||
|
|
||||||
3 1
|
3 1
|
||||||
|
|
||||||
4 0
|
4 0
|
||||||
|
|
||||||
fileB:
|
fileB:
|
||||||
|
|
||||||
1 0
|
1 0
|
||||||
|
|
||||||
2 1
|
2 1
|
||||||
|
|
||||||
3 0
|
3 0
|
||||||
|
|
||||||
4 1
|
4 1
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -441,11 +434,8 @@ awk -v OFS='\t' 'NR=FNR{a[$1]=$2;next} NF {print $1,((a[$1]=$2)? $2:"0")}' fileA
|
|||||||
```
|
```
|
||||||
|
|
||||||
1 0
|
1 0
|
||||||
|
|
||||||
2 1
|
2 1
|
||||||
|
|
||||||
3 0
|
3 0
|
||||||
|
|
||||||
4 0
|
4 0
|
||||||
|
|
||||||
##### round all numbers of file (e.g. 2 significant figure)
|
##### round all numbers of file (e.g. 2 significant figure)
|
||||||
@ -470,11 +460,8 @@ e.g.
|
|||||||
seperate
|
seperate
|
||||||
|
|
||||||
David cat,dog
|
David cat,dog
|
||||||
|
|
||||||
into
|
into
|
||||||
|
|
||||||
David cat
|
David cat
|
||||||
|
|
||||||
David dog
|
David dog
|
||||||
|
|
||||||
detail here: http://stackoverflow.com/questions/33408762/bash-turning-single-comma-separated-column-into-multi-line-string
|
detail here: http://stackoverflow.com/questions/33408762/bash-turning-single-comma-separated-column-into-multi-line-string
|
||||||
@ -745,21 +732,13 @@ for i in $(ls); do echo file $i;done
|
|||||||
wget -r -l1 -H -t1 -nd -N -np -A mp3 -e robots=off http://example.com
|
wget -r -l1 -H -t1 -nd -N -np -A mp3 -e robots=off http://example.com
|
||||||
```
|
```
|
||||||
//-r: recursive and download all links on page
|
//-r: recursive and download all links on page
|
||||||
|
|
||||||
//-l1: only one level link
|
//-l1: only one level link
|
||||||
|
|
||||||
//-H: span host, visit other hosts
|
//-H: span host, visit other hosts
|
||||||
|
|
||||||
//-t1: numbers of retries
|
//-t1: numbers of retries
|
||||||
|
|
||||||
//-nd: don't make new directories, download to here
|
//-nd: don't make new directories, download to here
|
||||||
|
|
||||||
//-N: turn on timestamp
|
//-N: turn on timestamp
|
||||||
|
|
||||||
//-nd: no parent
|
//-nd: no parent
|
||||||
|
|
||||||
//-A: type (seperate by ,)
|
//-A: type (seperate by ,)
|
||||||
|
|
||||||
//-e robots=off: ignore the robots.txt file which stop wget from crashing the site, sorry example.com
|
//-e robots=off: ignore the robots.txt file which stop wget from crashing the site, sorry example.com
|
||||||
|
|
||||||
|
|
||||||
@ -1295,13 +1274,9 @@ head -c 50 file
|
|||||||
##### group/combine rows into one row
|
##### group/combine rows into one row
|
||||||
|
|
||||||
e.g.
|
e.g.
|
||||||
|
|
||||||
AAAA
|
AAAA
|
||||||
|
|
||||||
BBBB
|
BBBB
|
||||||
|
|
||||||
CCCC
|
CCCC
|
||||||
|
|
||||||
DDDD
|
DDDD
|
||||||
```bash
|
```bash
|
||||||
cat filename|paste - -
|
cat filename|paste - -
|
||||||
|
Loading…
Reference in New Issue
Block a user