Wednesday, 31 May 2017

How to use Change the Case in Linux

Convert a file to all upper-case

$ cat employee.txt
100
200
300
400
Jason Smith
John Doe
Sanjay Gupta
Ashok Sharma
$ tr a-z A-Z < employee.txt
100 JASON SMITH
200 JOHN DOE

400 ASHOK SHARMA
Convert a file to all lower-case

$ cat department.txt
100
200
300
400
FINANCE
MARKETING
PRODUCT DEVELOPMENT
SALES

$ tr A-Z a-z < department.txt
100
200
300
400
finance
marketing
product development
sales

No comments:

Post a Comment

What is PS2 - Continuation Interactive Prompt in Linux

A very long command can be broken down to multiple lines by giving \ at the end of the line. The default interactive prompt for a multi-lin...