官术网_书友最值得收藏!

The tr command

The tr command is a Linux utility for text processing, such as translating, deleting, or squeezing repeated characters, which is shown as follows:

    $ tr '[a-z]' '[A-Z]' < filename

This will translate the lowercase characters to uppercase:

    $ tr '|' '~' < emp.lst

This will squeeze multiple spaces into a single space:

    $ ls -l | tr -s " "

In this example, the -s option squeezes multiple contiguous occurrences of the character into a single char. Additionally, the -d option can remove characters.

主站蜘蛛池模板: 十堰市| 荥阳市| 多伦县| 安顺市| 广水市| 武宣县| 自贡市| 会同县| 茌平县| 稷山县| 玉林市| 阜康市| 临朐县| 文安县| 上虞市| 彝良县| 南城县| 昭通市| 尖扎县| 赤峰市| 孟村| 揭西县| 奉贤区| 财经| 四平市| 介休市| 中阳县| 岳阳市| 方正县| 天气| 田阳县| 黑龙江省| 武宣县| 绍兴市| 如东县| 墨竹工卡县| 碌曲县| 九龙坡区| 右玉县| 绥德县| 阿城市|