I have always been a big fan of gnuplot as it allows you to create
quick graphs on the fly, and supports piping data to it.

It's possible to create real-time graphs using this.

I figured I'd share some useful bash oneliners:

-= graphical traceroute =-

   traceroute -q1 slashdot.org |\
     sed '1 d' |\
     awk '{print $1"\t"$4"\t"$2}' |\
     gnuplot -e 'set terminal dumb;set xtics rotate by -45' \
             -e 'plot "-" using 2:xticlabels(3) with lines'

120 +--------------------------------------------------------------------+
   |   +  +   +   +  +   +  +   +   +  +   +                     +  +   |
   |                                  "-" using 2:xticlabels(3) ******* |
100 |-+                                                              ***-|
   |                                                              **   *|
   |                                                            **      |
   |                                                          **        |
80 |-+                                                     ***        +-|
   |                                                     **             |
   |                                                  ***               |
60 |-+                                              **                +-|
   |                                              **                    |
   |                            ***            ***                      |
40 |-+                         *   *         **                       +-|
   |                          *     *********                           |
   |                         *                                          |
   |             ************                                           |
20 |-+         **                                                     +-|
   |  *********                                                         |
   |** +  +   +   +  +   +  +   +   +  +   +                     +  +   |
 0 +--------------------------------------------------------------------+
be-be-be-1be-141be-be-1be-2411-pe11.ashburbr0ar07-te13-3.lwdc.a216.105.38.15

-= disk usage plot =-

   find . -maxdepth 1 -type d -not -iname '.' -exec du -hs {} \; |\
     gnuplot -e 'set style data histogram; set terminal dumb; plot "-" using ($1/1024):xtic(2)'


0.14 +-------------------------------------------------------------------+
    |        +       +        +       +        +       +        +       |
    |      ****                     "-" using ($1/1024):xtic(2)         |
0.12 |-+    *  *                                                       +-|
    |      *  *                                                         |
    |      *  *                                                         |
0.1 |-+    *  *                                                       +-|
    |      *  *                                                         |
    |      *  *                                                         |
0.08 |-+    *  *                                                       +-|
    |      *  *                                                         |
0.06 |-+    *  *             ****     ***                              +-|
    |      *  *             *  *     * *                                |
    |      *  *             *  *     * *                                |
0.04 |-+    *  *             *  *     * *                              +-|
    |      *  *             *  *     * *                                |
    |      *  *             *  *     * *                                |
0.02 |-+    *  *             *  *     * *                      ****    +-|
    |      *  *     ***     *  *     * *                      *  *      |
    |      * +*     *+*     * +*     *+*       +       +      * +*      |
  0 +-------------------------------------------------------------------+
           ./api  ./.git  ./gradle ./.idea ./.gradle./codec ./creator


I think gnuplot is an example of a graphical application done
right: you can script it, pipe to it, etc... the graphical and tui
interfaces are interchangable.

I wish more graphical applications were written in a way such that
they can be combined with bash-kungfu.