//View Tip #572
» Convert permissions to octal
» Stream YouTube videos directly to your media player
» Print part of a file
» Check low space
Similar Tips
» Using sed across multiple lines» Convert permissions to octal
» Stream YouTube videos directly to your media player
» Print part of a file
» Check low space
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
No Comments

