Tips tagged grep


5

Tip #460   Random IP addresses

nmap -iR 20 -sL -n|awk '{print $2}'|grep '^[0-9]'|uniq Read more »

5

Tip #510   iso2cd

My little "iso2cd" alias. Not clean, but handy. The Burning device will be auto detected.

example call:
iso2cd debian_lenny_final.iso

alias iso2cd="cdrecord -s dev=`cdrecord --devices 2>&1 | grep "\(rw\|dev=\)" | awk {'print $2'} | cut -f'2' -d'=' | head -n1` gracetime=1 driveropts=burnfree -dao -overburn -v" Read more »

5

Tip #117   Find function declarations in PHP or JavaScript

function findfunc {
grep -R $1 * 2> /dev/null |grep function|grep -v .svn
}
Read more »

5

Tip #96   Find occurrences of a string in a large code base without firing

A slight improvement to #64 -- drops one grep and adds line numbers

Read more »

4

Tip #48   Check low space

Mail somebody about space running low in some path (ksh, bash):

Read more »

4

Tip #540   Command examples from shell-fu

The following isn't particularly pretty and should be considered a work in progress, but it's quite fun.

Get examples of ways a command can be used direct from shell-fu by adding the following alias:
Read more »

3

Tip #311   Filter stderr for cron jobs

Tired to get your mailbox full of cron information messages?
Eg.: some programs (pg_dump, /etc/init.d/xxx, ...) output informational messages on stderr, but you can't close stderr because it may also contain failure informations.

Read more »

3

Tip #87  

Perform a recursive grep of the Solaris /etc directory, bypassing those nasty sockets Sun keeps in there:
Read more »

3

Tip #525   Find words in garbled text

Have a bunch of garbled text? Curious as to what words might be found inside? Try the following:

Read more »

2

Tip #468   Moved Trac and Subversion repositories to another machine/direct

CASE: You've relocated Subversion and Trac repositories to another machine/directories. You don't want to edit n+1 trac.ini files.

You have for example:
/repos/svn-myprojects/my-first-project
/repos/trac-myprojects/my-first-project

/repos/svn-myprojects/my-second-project
/repos/trac-myprojects/my-second-project

...etc...

Change ALL trac.ini repository_dir settings:

trac-mass-repodir-edit.sh:
Read more »