junxnone / linux

Linux wiki
https://junxnone.github.io/linux/
0 stars 0 forks source link

Tools Text tr #26

Open junxnone opened 5 years ago

junxnone commented 5 years ago

tr

UseCase

Usecase cmd
替换大小写 cat testfile \| tr a-z A-Z
替换空格为逗号 cat log.txt \| tr ' ' ','
删除 Linux 换行符 cat testfile \| tr -d '\n'
删除 Windows 换行符 cat testfile \| tr -d '\r\n'

Reference