The tail -c, –bytes=[-]NUM option prints the last NUM bytes; or use -c +NUM to output starting with byte NUM of each file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
## create a file with 100 lines > myfile; i=1; while [ $i -le 100 ]; \ do echo "$i" >> myfile; ((i++)); done ls -l myfile ## myfile1 is 292 bytes long ## default tail myfile ## by default, returns bottom 10 lines ## tail NUM = positive integer tail -c 50 myfile ## returns last 50 bytes of data ## tail NUM = negative integer tail -c -50 myfile ## also returns last 50 bytes of data rm myfile |