Differences between revisions 1 and 2
Revision 1 as of 2024-12-28 19:03:04
Size: 683
Comment: Initial commit
Revision 2 as of 2024-12-28 19:05:28
Size: 751
Comment: Small clarification
Deletions are marked like this. Additions are marked like this.
Line 24: Line 24:
tr '[:upper:]' '[:lower:]' tr '[:upper:]' '[:lower:]' "Hello world"
#or
echo "Hello world" | tr '[:upper:]' '[:lower:]'

Tr

tr(1) is a character translation tool.


Installation

tr(1) will be pre-installed on any Linux or BSD operating system, as a POSIX utility.


Usage

To force text to all-lowercase, try:

tr '[:upper:]' '[:lower:]' "Hello world"
#or
echo "Hello world" | tr '[:upper:]' '[:lower:]'

Reverse the arguments to force to all-uppercase.


Tips

If you are trying to force a file to all-lowercase (or all-uppercase) and are already using vim, consider just saying in the editor and using ggVGu (or ggVGU).


See also

tr(1)


CategoryRicottone

Tr (last edited 2024-12-28 19:06:28 by DominicRicottone)