Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 612 Bytes

README.md

File metadata and controls

33 lines (24 loc) · 612 Bytes

sed-one-liners

Case Conversion

Convert all characters to lowercase

sed 's/\(.*\)/\L\1/g' some-file.txt

Convert all characters to uppercase

sed 's/\(.*\)/\U\1/g' some-file.txt

Capitalize first word, making everything lowercase

sed 's/\(.\)\(.*\)/\U\1\L\2/g' some-file.txt

Capitalize first letter of each word

sed 's/\b\(.\)/\U\1/g' some-file.txt

Find patterns in the input

Find words and group them inside parenthesis

$ cat input.txt | sed 's/[A-Za-z]*/(&)/g'  
(The) (quick) (brown) (fox) (jumps) (over) (the) (lazy) (dog)