Difference between revisions of "Tr"
Jump to navigation
Jump to search
↑ https://stackoverflow.com/a/9605450
Tags: Mobile web edit, Mobile edit |
|||
Line 8: | Line 8: | ||
* <code>[[cat]] file | tr '\n' ' '</code> | * <code>[[cat]] file | tr '\n' ' '</code> | ||
* <code>[[cat]] file | [[xargs]]</code> | * <code>[[cat]] file | [[xargs]]</code> | ||
+ | |||
+ | Remove | ||
+ | * <code>tr -d '\n'</code> | ||
Concatenate/[[merge]] every 2 lines: | Concatenate/[[merge]] every 2 lines: |
Revision as of 09:10, 24 March 2023
wikipedia:tr (Unix)
translate characters
Concatenate lines on a file:
Remove
tr -d '\n'
Concatenate/merge every 2 lines:
cat /path/tofile.txt | paste -d " " - -
[1]
cat file | tr '\n' tr: when not truncating set1, string2 must be non-empty
tr --help tr: illegal option -- - usage: tr [-Ccsu] string1 string2 tr [-Ccu] -d string1 tr [-Ccu] -s string1 tr [-Ccu] -ds string1 string2
Related commands
See also
tr, tr -d, cut -d, awk -F, tr -dc
cat
,tac
,more
,less
,tail
,mtail
,echo
,stdin
,tr
,column
,paste
,truncate
,logrotate
,xzcat
pv
,progress
,sort
,ncat
,virt-cat
,awk
,join
,col
,fold
,tee
,sponge
,nfs-cat
,journalctl, ccat, icat, EOF
, lolcat
Advertising: