//View Tip #572
» Copy and paste from the command line
» Random xkcd comic
» Check low space
» BBC Weather
Similar Tips
» SSH Auto Complete» Copy and paste from the command line
» Random xkcd comic
» Check low space
» BBC Weather

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'
Comments
Add your comment
Comments are currently disabled
No Comments