tr command line tutorial

 https://www.tecmint.com/tr-command-examples-in-linux/


tr means translate

It will walk through all the characters in the text and can translate a character or a phrase into a new character or a new phrase.


For example:

nguyenhuybo@VN-LV00184-N ~ % echo "Hello my love" | tr "[:lower:]" "[:upper:]"

HELLO MY LOVE


nguyenhuybo@VN-LV00184-N ~ % echo "{**} <3 me"| tr "{}" '[]'

[**] <3 me


nguyenhuybo@VN-LV00184-N ~ % echo I am sorry| tr "[:space:]" "\t"

I am sorry %    




Comments

Popular posts from this blog

Fixing the DeepSpeed Import Error While Fine-Tuning the Qwen Model

Amazon Linux 2023 - User data configuration for launch templates to connect to the EKS cluster

How to create ISM policy and rotate logs in opensearch