Re: [SLUG] A command question.

2008-11-21 Thread Amos Shapira
2008/11/21 Jobst Schmalenbach [EMAIL PROTECTED]: Hi. I beg to differ. 1: its quicker to type fstr HTML '*.php' It's shorter to define: function fstr() { grep -r --colour=always --include=${2:-*} $1 . | less -R; } If you insist on using fstr :) 2: less (and more) kill the highlighting

Re: [SLUG] A command question.

2008-11-20 Thread Jobst Schmalenbach
Hi. I beg to differ. 1: its quicker to type fstr HTML '*.php' 2: less (and more) kill the highlighting done by grep 3: grep has to (internally) call the other processes to to the same I am already doing with pipes 4: (overly pedantic): can do more with find grep can ever do and I can

Re: [SLUG] A command question.

2008-11-20 Thread Jeff Waugh
quote who=Jobst Schmalenbach 2: less (and more) kill the highlighting done by grep Use less -R and *never* use more! 3: grep has to (internally) call the other processes to to the same I am already doing with pipes No, there's a massive difference between syscalls and forking processes.

Re: [SLUG] A command question.

2008-11-16 Thread Jobst Schmalenbach
Put this into your .bashrc file: function fstr() { OPTIND=1 local case= local usage=fstr: find string in files.\nUsage: fstr [-i] \pattern\ [\filename pattern\] while getopts :it opt do case $opt in i) case=-i ;; *) echo $usage; return;;

Re: [SLUG] A command question.

2008-11-16 Thread Amos Shapira
2008/11/17 Jobst Schmalenbach [EMAIL PROTECTED]: Put this into your .bashrc file: function fstr() { OPTIND=1 local case= local usage=fstr: find string in files.\nUsage: fstr [-i] \pattern\ [\filename pattern\] while getopts :it opt ... find . -type f -name ${2:-*}

[SLUG] A command question.

2008-11-14 Thread wbennett
Is there a command that finds a file containing a certain word? find and apropos don't. They work on filenames only. Using Hardy H. Any suggestions gratefully etc. Bill Bennett -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs:

Re: [SLUG] A command question.

2008-11-14 Thread Jeff Waugh
quote who=[EMAIL PROTECTED] Is there a command that finds a file containing a certain word? find and apropos don't. They work on filenames only. grep ... and you can use -r to search through files/directories recursively. - Jeff -- Robot Parade

Re: [SLUG] A command question.

2008-11-14 Thread Rick Welykochy
Jeff Waugh wrote: quote who=[EMAIL PROTECTED] Is there a command that finds a file containing a certain word? find and apropos don't. They work on filenames only. grep ... and you can use -r to search through files/directories recursively. You can also use -i to do a case insensitive

Re: [SLUG] A command question.

2008-11-14 Thread Mada R Perdhana
find . -exec grep www.athabasca '{}' \; -print This command will search in the current directory and all sub directories. All files that contain the string will have their path printed to standard output. If you want to just find each file then pass it on for processing use the -q grep option.

Re: [SLUG] A command question.

2008-11-14 Thread Jeff Waugh
quote who=Mada R Perdhana find . -exec grep www.athabasca '{}' \; -print This is massively inefficient. A better choice would be grep -rl piped to xargs. grep -rl www.athabasca | xargs sed -i 's#www.athabasca#www.bathsheba#' - Jeff -- OSDC 2008: Sydney, Australia

Re: [SLUG] A command question.

2008-11-14 Thread Ben Nisenbaum
[EMAIL PROTECTED] wrote: Is there a command that finds a file containing a certain word? find and apropos don't. They work on filenames only. Using Hardy H. Any suggestions gratefully etc. Bill Bennett Hello Bill, find . -name * -print -exec grep word {} \; finds the word word in files