This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

grep -r demo

By: a guest on May 16th, 2012  |  syntax: None  |  size: 1.01 KB  |  views: 22  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. bash-4.2$ echo mytext > with
  2.  
  3. bash-4.2$ echo no > without
  4.  
  5. bash-4.2$ mkdir -p foo/bar
  6.  
  7. bash-4.2$ cp with* foo
  8.  
  9. bash-4.2$ cp with* foo/bar
  10.  
  11. bash-4.2$ tree
  12. .
  13. |-- foo
  14. |   |-- bar
  15. |   |   |-- with
  16. |   |   `-- without
  17. |   |-- with
  18. |   `-- without
  19. |-- with
  20. `-- without
  21.  
  22. bash-4.2$ grep -r mytext
  23. foo/bar/with:mytext
  24. foo/with:mytext
  25. with:mytext
  26.  
  27. bash-4.2$ grep -r mytext .
  28. ./foo/bar/with:mytext
  29. ./foo/with:mytext
  30. ./with:mytext
  31.  
  32. bash-4.2$ echo mytext | grep -r mytext  
  33. foo/bar/with:mytext
  34. foo/with:mytext
  35. with:mytext
  36.  
  37. bash-4.2$ echo no | grep -r mytext
  38. foo/bar/with:mytext
  39. foo/with:mytext
  40. with:mytext
  41.  
  42. bash-4.2$ grep --version
  43. grep (GNU grep) 2.12
  44. Copyright (C) 2012 Free Software Foundation, Inc.
  45. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
  46. This is free software: you are free to change and redistribute it.
  47. There is NO WARRANTY, to the extent permitted by law.
  48.  
  49. Written by Mike Haertel and others, see <http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.
clone this paste RAW Paste Data