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:
Nth line of a file - dirty hack way. I haven't used ed in ages ;-)
There are 8 alternatives - vote for the best!
This is not printing, real editing using the text editor.
Prints exactly 15th line of $file. You can also specify a range:
sed -n '2,18p' $file - this will print lines 2 to 18, inclusive.
Silly approach, but easy to remember...
If you can do better, submit your command here.
You must be signed in to comment.