While loop with head and tail in linux
Hi All!
In today's post we're going to see/refresh about while loop with head and tail in bash.
- head - Read the first top 'n' lines. Example: head -n 5 reads first 5 lines from a file or input.
- tail - Read the last 'n' lines. Example: tail -n 5 reads last 5 lines from a file or input.
Please look into the below image
we have a txt file called file1.txt which has 3 lines of text and we read using head and tail as above.
Comments
Post a Comment