//View Tip #572
Similar Tips
» SSH Auto Complete
» Copy and paste from the command line
» Stream YouTube videos directly to your media player
» Using Perl instead of Sed
» Create daily backups

 

Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
This bit of sed will print the contents of a file until the first line which doesn't contain the specified expression. A useful alternative to 'head' when you're not sure how much of the file you need.

sed -n '/Hello/!q; p'


View Comments »




Comments 

Add your comment

Comments are currently disabled
No Comments

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit