In a file, I have 100 lines. But I want 17th and last but one as 99th line from the file. I need the command combinedly.
Get the 17th line:
head -17 file | tail -1
Get the 99th line:
tail -2 file | head -1
Combine the commands with a semicolon:
head -17 file | tail -1 ; tail -2 file | head -1
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.