Output line range from text file

Posted in Quick Tips | 1 comment
Tags: ,

This post is a part of series of Ubuntu Command Line Tricks posts in which I try to share really useful CLI commands — as it comes from terms “terminal command”, “console command”, they are to be executed in Terminal: Ubuntu Main Menu –> Accessories –> Terminal.

Need to print part of text file, e.g. the lines starting from 20th to 30th? It’s no need to use bash scripts or other things like python for that anymore! Here you go:

sed -n '20,30p' /etc/passwd

This command just outputs the line range from 20 to 30. Damn it, I was using the long bash equivalent for the same task for years :(

Follow @Ubuntuka on Twitter!
RSSComments

AdobePhotoshopCS6crack

Posted on March 17, 2013 at 7:27 pm

All the time the world we perceive is reflecting our internal dialog. ~Deepak Chopra Adobe Photoshop CS6 crack http://www.youtube.com/watch?v=sB-JLGkleK

Post a comment

Hello guest, care to post a comment?