Quick transformations on streams: convert, delete and squeeze characters directly in the shell. 17.05.2026 | reading time: 2 min Need to convert or clean text on the fly? The `tr` command translates, deletes and squeezes characters from stdin to stdout, making it ideal for stream edits inside pipelines. Do this: a compact example Here is a real pipeline that squeezes multiple spaces, deletes digits and converts to uppercase: ```bash $ echo "hello world 123" | tr -s ' ' | tr -d '0-9' | tr '[:lower:]' '[:upper:]' HELLO WORLD ``` Run it as shown and see how `tr` transforms the stream step by step. Options you will use Use `-d` to delete characters, `-s` to squeeze repeated characters, and `-c` to operate on the complement of a set; use character classes like `[:lower:]` and ranges like `a-z` to keep expressions concise and portable. Limits and gotchas `tr` works byte-wise and is not multibyte aware, so it can corrupt UTF-8 text when used on non-ASCII characters; for multilingual text prefer tools that understand encoding, or convert encoding first with a dedicated tool. Tools to pair with tr Combine `tr` with `echo` or `cat` for quick inline edits, use `sed` when you need regex-based replacements, and choose `awk` or `perl` for field-aware or complex transformations; sometimes `iconv` is required to normalize encoding before `tr`. Where to go next Start applying `tr` inside pipelines to save scripting time and to keep logs tidy; when you are ready, learn `sed`, `awk` and `perl` to handle progressively more complex tasks and consider formal study such as CompTIA Linux+ or LPIC-1 at bitsandbytes.academy to deepen command-line mastery. Join Bits & Bytes Academy First class LINUX exam preparation. utilities scripting filesystem