Check These Out
Useful when you forget to use sudo for a command. "!!" grabs the last run command.
git log --format=%H | tail -1 doesn't work anymore
Very useful in shell scripts because you can run a task nicely in the background using job-control and output progress until it completes.
Here's an example of how I use it in backup scripts to run gpg in the background to encrypt an archive file (which I create in this same way). $! is the process ID of the last run command, which is saved here as the variable PI, then sleeper is called with the process id of the gpg task (PI), and sleeper is also specified to output : instead of the default . every 3 seconds instead of the default 1. So a shorter version would be sleeper $!;
The wait is also used here, though it may not be needed on your system.
$ echo ">>> ENCRYPTING SQL BACKUP"
$ gpg --output archive.tgz.asc --encrypt archive.tgz 1>/dev/null &
$ PI=$!; sleeper $PI ":" 3; wait $PI && rm archive.tgz &>/dev/null
Previously to get around the $! not always being available, I would instead check for the existance of the process ID by checking if the directory /proc/$PID existed, but not everyone uses proc anymore. That version is currently the one at http://www.askapache.com/linux-unix/bash_profile-functions-advanced-shell.html but I plan on upgrading to this new version soon.
Searches all .php files for a static instantiation of a class and displays the class names along with their frequencies.
Shows a simple clock in the console
-t param removes the watch header
Ctrl-c to exit
bs = buffer size (basically defined the size of a "unit" used by count and skip)
count = the number of buffers to copy (16m * 32 = 1/2 gig)
skip = (32 * 2) we are grabbing piece 3...which means 2 have already been written so skip (2 * count)
i will edit this later if i can to make this all more understandable
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"