Check These Out
It's very common to have cron jobs that send emails as their output, but the From: address is whatever account the cron job is running under, which is often not the address you want replies to go to. Here's a way to change the From: address right on the command line.
What's happening here is that the "--" separates the options to the mail client from options for the sendmail backend. So the -f and -F get passed through to sendmail and interpreted there. This works on even on a system where postfix is the active mailer - looks like postfix supports the same options.
I think it's possible to customize the From: address using mutt as a command line mailer also, but most servers don't have mutt preinstalled.
If everything validates, there's no output. Can be handy to run on a cron job set up to email output.
Working with log files that contains variable length messages wrapped between open and close tags it may be useful to filter the messages upon a keyword.
This works fine with GNU sed version 4.2 or higher, so pay attention to some unix distros (solaris, hp-ux, etc.).
Linux should be ok.
fancy command line ncdu clone
Just an alternative with more advanced formating for readability purpose. It now uses colors (too much for me but it's a kind of proof-of-concept), and adjust columns.
I took java to make the find command simpler and to state that it works for any language supported by cpp.
cpp is the C/C++ preprocessor (interprets macros, removes comments, inserts includes, resolves trigraphs). The -fpreprocessor option tells cpp to assume the input has already been preprocessed so it will only replace comment lines with blank lines.
The -L 1 option tells xargs to launch one process for each line, indeed cpp can only process one file at the time...
use -iname \*[.ch] instead of -iname \*.c -o -iname \*.h
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
This will calculate the your commandlinefu votes (upvotes - downvotes).
Hopefully this will boost my commandlinefu points.