commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Avoids creating useless directory entries in archive, and sorts files by (roughly) extension, which is likely to group similar files together for better compression. 1%-5% improvement.
GNU find + sort
no fancy grep stuff here.
Uses the dumb terminal option in gnuplot to plot a graph of frequencies. In this case, we are looking at a frequency analysis of words in all of the .c files.
handles file names with spaces and colons, fixes sort (numeric!), uses mplayer, same output format as other alternatives
Similar but using mediainfo instead of totem-something
Sort .avi movies by time length, print the longest first, and so on...
Since coreutils 7.6 provides sort -h
You'll run into trouble if you have files w/ missing newlines at the end. I tried to use
PAGER='sed \$q' git blame
PAGER='sed \$q' git -p blame
to force a newline at the end, but as soon as the output is redirected, git seems to ignore the pager.
Figures out total line contribution per author for an entire GIT repo. Includes binary files, which kind of mess up the true count.
If crashes or takes too long, mess with the ls-file option at the start:
git ls-files -x "*pdf" -x "*psd" -x "*tif" to remove really random binary files
git ls-files "*.py" "*.html" "*.css" to only include specific file types
Based off my original SVN version: http://www.commandlinefu.com/commands/view/2787/prints-total-line-count-contribution-per-user-for-an-svn-repository
note the xargs at the end
Use the hold space to preserve lines until data is needed.
List packages and their disk usage in decreasing order. This uses the "Installed-Size" from the package metadata. It may differ from the actual used space, because e.g. data files (think of databases) or log files may take additional space.
counts the total (recursive) number of files in the immediate (depth 1) subdirectories as well as the current one and displays them sorted.
Fixed, as per ashawley's comment
This dup finder saves time by comparing size first, then md5sum, it doesn't delete anything, just lists them.
Show apps that use internet connection at the moment.
Can be used to discover what programms create internet traffic. Skip the part after awk to get more details, though it will not work showing only unique processes.
This version will work with other languages such as Spanish and Portuguese, if the word for "ESTABLISHED" still contain the fragment "STAB"(e.g. "ESTABELECIDO")
This corrects duplicate output from the previous command.