Tips tagged awk


110

Tip #275   Get an ordered list of subdirectory sizes

This piece of code lists the size of every file and subdirectory of the current directory, much like du -sch ./* except the output is sorted by size, with larger files and directories at the end of the list. Useful to find where all that space goes.

Read more »

20

Tip #551   My code is compiling

Simulate a never-ending compilation so you have an excuse for why you're browsing the net (see http://xkcd.com/303/):

Read more »

20

Tip #173   Count files by type

To find out the number of files of each type in your current directory try the following:

Read more »

15

Tip #220   Actively Monitor a File

This is a way to monitor "/var/log/messages" or any file for certain changes.
The example below actively monitors "stuff" for the word "now" and as soon as "now" is added to the file, the contents of msg are sent by email

Read more »

12

Tip #92   Sort a file by line length

Sort a file by line length:

Read more »

12

Tip #247   See your favorite commands

Use the following to see the commands you use most often based on your shell history:

Read more »

10

Tip #313   Get latest stable version of the Linux kernel

A simple shell script to get the latest stable version of the linux kernel:

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 »