Hello,
I have a group of text files with many lines in each file.
I need to delete all the lines in each and only leave 2 lines in each file.
Hello,
I have a group of text files with many lines in each file.
I need to delete all the lines in each and only leave 2 lines in each file.
What lines do you want to keep? The first, the last, lines containing word abc? In order to help you you need to give us more information...
keep the first two lines only on each file.
find /PATH -type f -exec sed -i '3,$'d {} \;