User Tools

Site Tools


linux:text

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux:text [2026/05/19 12:03] – created v1ctorlinux:text [2026/05/20 08:01] (current) – [TR] v1ctor
Line 1: Line 1:
 ====== WORKING WITH TEXT IN LINUX ====== ====== WORKING WITH TEXT IN LINUX ======
  
-==== TR ====+===== TR ====
 + 
 +''tr'' (translate) is a stream filter that operates on single characters, not patterns or words. It reads stdin and writes stdout, transforming one character at a time. 
 + 
 +== SQUEEZE == 
 + 
 +Squeeze (-s) collapse repeats: 
 +<code bash> 
 +tr -s ' '              # multiple spaces → single space 
 +tr -s '\n'             # collapse blank lines 
 +tr -s ' ' ','          # squeeze spaces AND translate to comma (combined) 
 +</code> 
  
-'tr' (translate) is a stream filter that operates on single characters, not patterns or words. It reads stdin and writes stdout, transforming one character at a time. 
linux/text.1779192200.txt.gz · Last modified: by v1ctor