//View Tip #818
Similar Tips
» Counts files in the current directory and subdirectory
» Get your IP in one line
» Check low space
» Graph connections to hosts
» Get real names of current users

 

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
The awk command below will print out the first line of each paragraph in a file. Paragraphs must be separated by a blank line for this to work.

awk 'NR==1||cnt-->0;/^$/{cnt=1}' file.txt


View Comments »




Comments 

Add your comment

Comments are currently disabled
No Comments

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit