User Tools

Site Tools


linux:text

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:text [2026/05/19 12:03] – [TR] 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. ''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>
 +
 +
linux/text.1779192208.txt.gz · Last modified: by v1ctor