set -o/+o: Bật hoặc tắt các tùy chọn khác nhau mà ảnh hưởng đến hành vi của shell (Shell bash)

wc - Đếm số lượng theo thứ tự: chữ, dòng, kí tự

ubuntu@Ubuntu:~$ cat count.txt
one
two
three
four
five

ubuntu@Ubuntu:~$ wc count.txt
5 5 24 count

Options của wc

Sort: Sắp xếp các chữ theo alphabet

ubuntu@Ubuntu:~$ cat count.txt
one
two
three
four
five

ubuntu@Ubuntu:~$ sort count.txt
five
four
one
three
two

ubuntu@Ubuntu:~$ cat music.txt
Queen
Brel
Queen
Abba
India
US

ubuntu@Ubuntu:~$ sort music.txt | uniq
Abba
Brel
India
Queen
US

ubuntu@Ubuntu:~$ sort music.txt | uniq -c
	1 Abba
	1 Brel
	1 India
	2 Queen
	1 US

sed - Thay thế chữ

ubuntu@Ubuntu:~$ echo level5 | sed 's/5/42/'
level42
ubuntu@Ubuntu:~$ echo level5 | sed 's/level/jump/'
jump5

ubuntu@Ubuntu:~$ echo level5 level7 | sed 's/level/jump/'
jump5 level7
ubuntu@Ubuntu:~$ echo level5 level7 | sed 's/level/jump/g'
jump5 jump7

ubuntu@Ubuntu:~$ cat tennis.txt 
Venus Williams, USA
Martina Hingis, SUI
Justine Henin, BE
Serena williams, USA
Kim Clijsters, BE
Yanina Wickmayer, BE
ubuntu@Ubuntu:~$ cat tennis.txt | sed '/BE/d'
Venus Williams, USA
Martina Hingis, SUI
Serena williams, USA