Advertisement
Guest User

Untitled

a guest
May 27th, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. if [ $# -lt 1 ]; then
  2. echo "
  3. ff - Find files and content in files
  4.  
  5. Find content in a file:
  6. usage : ff [-t] EXTENSION SEARCH
  7. example : ff php logdir
  8. -t : omit text (show filenames only)
  9.  
  10. Find a file:
  11. usage : ff PATTERN
  12. example : ff *.css
  13. "
  14. exit 1
  15. fi
  16.  
  17. if [ $# == 1 ]; then
  18. find . -name "$1"
  19. elif [ $1 == "-t" ]; then
  20. grep --color=always --include=*.$2 -rnwl . -e "$3" | less -rF
  21. else
  22. grep --color=always --include=*.$1 -rnw . -e "$2" | less -rF
  23. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement