tkaczanowski

grep, find, sed examples

Oct 3rd, 2011
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.41 KB | None | 0 0
  1. #rgrep
  2. grep -r --include="pom.xml" aspectj .
  3.  
  4. #inverse
  5. grep -v 'http://' *.txt
  6. #inverse will remove lines containing a or b
  7. grep -Ev 'a|b' source.txt > dest.txt
  8.  
  9. #find all .deb SNAPSHOTS older than 300 minutes, and print their size
  10. find . -type f -name *-SNAPSHOT.deb -mmin +300 | xargs du -hs
  11.  
  12. #find (non-greedy) text between two strings (multiline is ok)
  13. sed -n '/CARL CHECK/,/CARL END/{n;p}' preface.txt
Advertisement
Add Comment
Please, Sign In to add comment