The below awk command will print every 6th line of a file test.txt starting from line number one.
awk '{if(NR%6==1) print $0}' test.txt
(Note: Print every nth line using awk.)
awk '{if(NR%6==1) print $0}' test.txt
(Note: Print every nth line using awk.)
1 comment:
It was very nice article and it is very useful to Linux learners.We also provide Linux online training
Post a Comment