[glug-t] One Day One GNU/Linux Command (TR)
- From: Bharathi Subramanian <sbharathi@xxxxxxxxxxxxx>
- To: GNU/Linux Users Group - Trichy <glug_t@xxxxxxxxxxxxx>, GNU/Linux User Group of TCE <glugot@xxxxxxxxxxxxx>, VEC-FOSS <vecfoss@xxxxxxxxxxxxxxxx>
- Date: Thu, 5 Jun 2008 10:57:35 +0530 (IST)
One Day One GNU/Linux Command
=============================
tr - TRanslate or Delete characters
Summary:
tr will translate, squeeze, and/or delete characters from stdin,
writing to stdout. 'tr' supports few standard Esc sequences, regular
expressions, char classes (lower, upper, space, blank, alpha ...),
etc.
Examples:
$ echo "tenet" | tr "tn" "TN" -- Translate t to T & n to N.
$ echo "ilugc" | tr "[a-z]" "[A-Z]" -- Change case (lower to upper)
$ echo "ilugc" | tr '[:lower:]' '[:upper:]' -- Same as above.
$ echo "HelloooOOOoooo" | tr -s '[:lower:]' -- Squeeze the "lower"
case letters.
$ echo "IwLxUyGzC" | tr -d xyz -- Remove xyz
$ cat myfile | tr -s '\n' -- Remove repeated new lines.
$ echo "ABCDEFG" | tr -c "ACEG" "\n" -- Expect "ACEG" translate
others to newline char.
Read : man tr
Bye :)
--
Bharathi S
---------------------------------------------------------------
To unsubscribe send a mail to glug_t-request@xxxxxxxxxxxxx with
'unsubscribe' as subject.
Website: http://glugt.linuxisle.com
Other related posts:
- » [glug-t] One Day One GNU/Linux Command (TR)