Hack #12 -> Change the Case

Convert a file to all upper-case

$ cat employee.txt

100 Jason Smith

200 John Doe

300 Sanjay Gupta

400 Ashok Sharma

$ tr a-z A-Z < employee.txt

100 JASON SMITH

200 JOHN DOE

300 SANJAY GUPTA

400 ASHOK SHARMA

Convert a file to all lower-case

$ cat department.txt

100 FINANCE

200 MARKETING

300 PRODUCT DEVELOPMENT

400 SALES

$ tr A-Z a-z < department.txt

100 finance

200 marketing

300 product development

400 sales

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s