Difference between revisions of "Tr"
Jump to navigation
Jump to search
↑ https://stackoverflow.com/a/9605450
Line 2: | Line 2: | ||
<code>[[wikipedia:tr (Unix)]]</code> translate characters | <code>[[wikipedia:tr (Unix)]]</code> translate characters | ||
* https://man7.org/linux/man-pages/man1/tr.1p.html | * https://man7.org/linux/man-pages/man1/tr.1p.html | ||
+ | |||
Line 14: | Line 15: | ||
[[cat]] file | tr '\n' '' | [[cat]] file | tr '\n' '' | ||
tr: when not truncating set1, string2 must be non-empty | 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 == | == Related commands == |
Revision as of 01:04, 18 June 2022
wikipedia:tr (Unix)
translate characters
Concatenate lines on a file:
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
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- file, File system, directory,
touch
,mkdir
,ls
,ln
truncate
,fallocate
,split
,stat
, inode, File descriptor, superblock, block size (blockdev
),fuser
,lsof
,scrub
,chattr
, ulimit (nofiles),cp
,mv
,file (command)
,mkfifo
,chmod
Advertising: