commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
this method should be the fastest
There are 3 alternatives - vote for the best!
Prints the 4th line and then quits. (Credit goes to flatcap in comments: http://www.commandlinefu.com/commands/view/6031/print-just-line-4-from-a-textfile#comment.)
using tail first won't do it because tail counts from the bottom of the file. You could do it this way but I don't suggest it
d --> delete
!d ---> delete others
Perl version - just for completeness sake ;)
If you can do better, submit your command here.
You must be signed in to comment.