Tip #215 Calendar with today colored [handle single digit dates]
If your version of grep supports coloring matches, you can use the following to give a calendar with the current date colored:Read more »
Tip #189 Remove every file but one
It's easy to remove (or copy, move etc.) all files that match a given criteria, but harder to move all but ones excluded by a criteria.To do this we can combine grep's -v option with Unix command substitution:
Read more »
Tip #22 Grepping for processes
Grepping for a process will return the grep command, this can be avoided by adding '| grep -v grep' to a command or easier in some cases altering the regular expression by adding brackets around a character.Read more »
Tip #21
Place a filename at the beginning of the line to make it easier to edit the search at the end of the command.Read more »
- TAGS:
- grep
- redirection
Tip #64 Find occurrences of a string in a large code base without firing
example, look for all the TODO and HACK strings I left in large java project and show a bit of context before and after using the -C switch of grep.Read more »
Tip #87
Perform a recursive grep of the Solaris /etc directory, bypassing those nasty sockets Sun keeps in there:Read more »
- TAGS:
- grep
Tip #88 a better cut
use `grep -o` to select only the pattern matched rather than the whole line:Read more »
- TAGS:
- grep
alias aptitude at awk bash bc cal cat cd colrm comm cp csh curl cut date dd df dialog diff dirname dpkg du fc find fuser grep gs gzip history iconv kill ksh last less ln ls lsof lynx m4 md5sum mkdir mkfifo mkisofs mv mysql nc netstat openssl OSX perl ping popd ps pushd python read redirection rm scp screen sed sort ssh stat sudo svn tail tar tee test top tr uniq vim wc wget xargs