# To replace : with a new line:
echo $PATH | tr ":" "\n"
echo $PATH | tr -t ":" \n
# To remove all occurance of "ab":
echo aabbcc | tr -d "ab" # ouput: cc
# To complement "aa":
# ("Complement" means to keep "aa", and replace all others with "x")
echo aabbccd | tr -c "aa" x # output: aaxxxxx (no newline)
# To complement "ab\n":
echo aabbccd | tr -c "ab\n" x #output: aabbxxx (with newline)
# To preserve all alpha(-c). ":-[:digit:] etc" will be translated to "\n". sequeeze mode:
echo $PATH | tr -cs "[:alpha:]" "\n"
# To convert an ordered list to an unordered list:
echo "1. /usr/bin\n2. /bin" | tr -cs " /[:alpha:]\n" "+"
# To remove all NULLs:
tr < file-with-nulls -d '\000' > file-without-nulls
Tuesday, 27 May 2025
tr
TermRecord
TermRecord is a simple terminal session recorder with easy-to-share self-contained HTML output! TermRecord -o /tmp/session.html
-
7z : Compression utility aa : a simple utility to help create backups ab : Apache HTTP server benchmarking tool aespipe : AES encrypti...
-
grub-mkconfig - generate a GRUB configuration file grub-mkconfig -o /boot/grub/grub.cfg
-
# To sort directories/files by size: du -sk *| sort -rn # To show cumulative human-readable size: du -sh # To show cumulative human-readabl...