commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for:
I often need to add a timestamp to a file, but I never seem to remember the exact format string that has to be passed to the date command to get a compact datetime string like 20090220T231410 (i.e yyyymmddThhmmss, the ISO 8601 format popular outside the US)
instead of writing:
if [[ "$1" == "$2" ]]; then
echo "$1 is equal $2"
else
echo "$1 differs from $2"
fi
do write:
[[ "$1" == "$2" ]] && echo "$1 is equal $2" || echo "$1 differs from $2"
This finds a process id by name, but without the extra grep that you usually see. Remember, awk can grep too!
Pump up the chatter, run this script on a regular basis to listen to your twitter timeline.
This is a rough first cut using several cli clips I have spotted around. There is no facility to not read those things already read to you. This could also easily be put in a loop for timed onslaught from the chatterverse, though I think it might violate several pointsof the Geneva Convention
UPDATE - added a loop, only reads the first 6 twits, and does this every 5 mins.
On other systems, replace 'say' with the name of another text-to-speech engine, e.g. espeak ( http://espeak.sourceforge.net ) or festival ( http://www.cstr.ed.ac.uk/projects/festival )
-P displays a progress meter
-z tells rsync to use compression
or replace "espeak" with "festival --tts" if you like festival better
when your buddy leaves his computer unlocked use "crontab" or "at" to play at some time that would be most embarassing (during his next sales presentation)
echo "fortune -o | espeak" | at now + 30 minutes
of course you can exclude the "-o" for non offensive fortunes, or if you don't have offensive fortunes installed