Tsallaka zuwa abun ciki
Justice Tech School

wc, head and tail

wc counts lines, words and bytes. head and tail show the start and end.

Example
seq 1 10 > /tmp/n.txt
wc -l < /tmp/n.txt
head -n 3 /tmp/n.txt
tail -n 2 /tmp/n.txt
sed -n "4,6p" /tmp/n.txt
rm /tmp/n.txt

Result

10
1
2
3
9
10
4
5
6

Exercise

Last lines.

 -n 2 f

Quiz Test

What does wc -l count?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.