Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?
You must be signed in to comment.
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for:
[david.ward@om012234 ~/dev]$ ll cgfxShader.so
-r-xr-xr-x 1 david.ward sysadmins 394578 May 20 14:09 cgfxShader.so
[david.ward@om012234 ~/dev]$ find . -type f -iname "*cgfxsh*"
./cgfxShader.so
bash -s argv1
alias ekko='echo $1'
ekko test
Also, you need to use the `-print0 | -0` construct - the completely correct version would be:alias findstring='find . -type f -print0 | xargs -0 grep -H'
grep -r "$1" ./*
find . -type f -exec grep -H {} "search string" \;
Although instead of an alias you could us a bash function which does support arguments, although you have to be a little careful about quoting. I have a command in my bashrc for grepping many files:function grepfiles () { grep -lr "$1" $2; }
use the --include option to restrict the search to .c files or whatever. In bash 4.0 and zsh (and possibly in other shells) there is the ** globbing syntax which means "at any depth" so potentially you could accomplish what you are trying to do with:function findstring () { grep -H "$1" **/"$2" }