Comments on: 10 tr Command Examples in Linux https://www.tecmint.com/tr-command-examples-in-linux/ Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks. Thu, 13 Jul 2023 19:28:05 +0000 hourly 1 By: Shalinda Fernando https://www.tecmint.com/tr-command-examples-in-linux/comment-page-1/#comment-1929539 Tue, 13 Dec 2022 09:45:16 +0000 https://www.tecmint.com/?p=30891#comment-1929539 Just to inform there is a typo in the 6th point. Have a look:

$ cat domains.txt | tr -s ” <= Original
$ cat domains.txt | tr -s '.' <= Edited: Notice the "." (dot)

Output:

www.tecmint.com
www.fossmint.com
www.linuxsay.com

]]>
By: Ravi Saive https://www.tecmint.com/tr-command-examples-in-linux/comment-page-1/#comment-1909041 Thu, 03 Nov 2022 06:38:21 +0000 https://www.tecmint.com/?p=30891#comment-1909041 In reply to kl.

@kl,

Thanks, corrected the command in the article…

]]>
By: kl https://www.tecmint.com/tr-command-examples-in-linux/comment-page-1/#comment-1909039 Thu, 03 Nov 2022 06:34:09 +0000 https://www.tecmint.com/?p=30891#comment-1909039 Thanks for the great examples. There is a small typo in the first example.

You do

$ cat linux.txt

linux is my life
linux has changed my life
linux is best and everthing to me..:)

and then

$ cat domains.txt | tr [:lower:] [:upper:]

LINUX IS MY LIFE
LINUX HAS CHANGED MY LIFE
LINUX IS BEST AND EVERTHING TO ME..:)

This should be instead.

$ cat linux.txt | tr [:lower:] [:upper:]

]]>
By: bart https://www.tecmint.com/tr-command-examples-in-linux/comment-page-1/#comment-1808429 Sat, 28 May 2022 13:00:18 +0000 https://www.tecmint.com/?p=30891#comment-1808429 Hi, How can I remove duplicates of the words from a large text file using the tr command?

]]>
By: Phil Headford https://www.tecmint.com/tr-command-examples-in-linux/comment-page-1/#comment-1608483 Sat, 16 Oct 2021 02:41:56 +0000 https://www.tecmint.com/?p=30891#comment-1608483 I have a string that I assigned to a key combination, ctrl+k. The intention is to take the selected (highlighted) text in a textbox in one application, strip out all dots, replace all spaces with underscores, then place the amended text in the clipboard. the line is:

xcopy -o | tr " " "_" | tr -d "." | xcopy -selection clipboard

When I test the line in a terminal, it works fine. If I try it using ctrl+k, it leaves dots in the output string in the clipboard. This is puzzling me.

]]>