Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if [ $# -lt 1 ]; then
- echo "
- ff - Find files and content in files
- Find content in a file:
- usage : ff [-t] EXTENSION SEARCH
- example : ff php logdir
- -t : omit text (show filenames only)
- Find a file:
- usage : ff PATTERN
- example : ff *.css
- "
- exit 1
- fi
- if [ $# == 1 ]; then
- find . -name "$1"
- elif [ $1 == "-t" ]; then
- grep --color=always --include=*.$2 -rnwl . -e "$3" | less -rF
- else
- grep --color=always --include=*.$1 -rnw . -e "$2" | less -rF
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement