Command line bar graph
Date: September 29, 2016
sup
i decided to write this command line bar graph (with portions taken from here) that shows graphs based on the amount of files and extensions in a dir (recursive or non-recursive).
need came about due to not wanting to grep, sort and uniq certain folders at the time for what i was doing.
here is the usage animation:
click to enlarge
here is the usage:
NAME
bargraph.sh - show bar graphs of dir file types
SYNOPSIS
bargraph.sh [OPTION]...
DESCRIPTION
This script shows a bar graph with the total count
of files in a dir according to extension.
-b [character]
This is to specify what character you want to use to
draw your bar graphs. If this option is used, place
the character in quotes (ex: "#").
Default is "#"
-d [path]
This is to specify the path to be used. Need to input
this for the script to work.
-e [ext{,ext,ext}]
This option is to select a single or list of extensions
to show in the bargraph.
Usage is either { -e "foo" } for single extension or
{ -e "foo,bar,baz" } for multiple. Always comma separated.
-h Show this file (usage).
-r Recursive.
-s This sorts output according to most files.
Default is sorted by name.
-v Show version.
Leave a Reply