Check These Out
you can listen to your computer, but don't be carried away
checkfor: have the shell check anything you're waiting for.
'while : ; do' is an infinite loop
'$*' executes the command passed in
'sleep 5' - change for your tastes, sleep for 5 seconds
bash, ksh, likely sh, maybe zsh
Ctrl-c to break the loop
A *.tar.gz file needs to be unzipped & then untarred. Previously I might have unzipped first with
$gunzip -d file.tar.gz
and then untarred the result with
$tar -xvf file.tar
(Options are extract, verbose, file)
Using the -z (decompress) option on tar avoids the use of gzip (or gunzip) first.
Additionally the -C option will specify the directory to extract to.
Requires googlecl (http://code.google.com/p/googlecl/)
Even better when you wrap this in a script and allow the --date=STRING to be $1. Then you can type:
whatson "next Thursday"
The date string for UNIX date is very flexible. You can also add --cal "[regex]" to the end for multiple calendars.
You can install filterous with
$ sudo apt-get install libxslt1-dev; sudo easy_install -U filterous
This can be particularly useful used in conjunction with a following cut command like
$echo "hello::::there" | tr -s ':' | cut -d':' -f2
which prints 'there'. Much easier that guessing at -f values for cut. I know 'tr -s' is used in lots of commands here already but I just figured out the -s flag and thought it deserved to be highlighted :)
for udp
nmap -sU -p 80 hostname
The backslash avoids any 'rm' alias that might be present and runs the 'rm' command in $PATH instead.
In a misguided attempt to be more "friendly", some Linux distributions (or sites/etc.) alias 'rm' to 'rm -i'. Unfortunately, this trains users to expect that files won't actually be deleted until they okay it. This expectation will fail with catastrophic results when they use other distributions, move to other sites, etc., and doesn't really even work 100% even with the alias. It's too late to fix 'rm', but '\rm' should work everywhere (under bash).
Bash's history expansion character, "!", has many features, including "!:" for choosing a specific argument (or range of arguments) from the history. The gist is any number after !: is the number of the argument you want, with !:1 being the first argument and !:0 being the command. See the sample output for a few examples. For full details search for "^HISTORY EXPANSION" in the bash(1) man page.
Note that this version improves on the previous function in that it handles arguments that include whitespace correctly.