Tips tagged grep


183

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 »

29

Tip #192   Print a random shell-fu tip

Print a random shell-fu tip:
Read more »

26

Tip #892   Check memory and swap from command line

Want to check the amount of used, free and total memory and swap from the command line? This script displays memory and swap information. Fully posix compliant and should work with all 2.[2-6].* kernels .

Read more »

24

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 »

24

Tip #885   Random password generator.

Generate a random 8 character password containing a-z, A-Z and 0-9:

Read more »

14

Tip #147   Find and Grep

Find all files with given name (you can use Bash expansion if you'd like), and Grep for a phrase:
Read more »

14

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 »

11

Tip #93   Subtract one file from another

Subtract a small file from a bigger file.

Read more »

10

Tip #290   Crawl a web page for links

lynx -dump http://www.spantz.org | grep -A999 "^References$" | tail -n +3 | awk '{print $2 }' Read more »