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.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
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.
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:
this command can be added to crontab so as to execute a nightly backup of directories and store only the 10 last backup files.
Mac have direct conversion of seconds (Epoch time)
This function will find the modification time in unix_time of the given file, then calculate the number of minutes from now to then and then find all files modified in that range.
Downloads a CRL file, determines the expiration time, and checks when it will expire
bash brace expansion, sequence expression
The easiest way to convert epoch date to human readable format.
Useful if localhost is a small machine running BusyBox, which uses a slightly unusual format to set the date. Remotehost can be pretty much any Linux machine, including one running BusyBox. Uses UTC for portability.
My first command :) I made this command to log public addresses of a virtual interface who connects random VPN servers around the world.
Starts and shows a timer. banner command is a part of the sysvbanner package. Instead of the banner an echo or figlet commands could be used. Stop the timer with Ctrl-C and elapsed time will be shown as the result.
pretty much the same.
I use awk rather than grep and perl.
It looks like the URL has been updated.
The service tag can also be retrieved via snmp - potential for a for loop over a list of servers. I might have a look into doing an example.
using -u is better for standardizing date output and timezones, for servers in different timezones.
grabbed from Andrew Aylett post:
Take a picture from your webcam and save it to a jpeg.
A very slightly modified version of MarxBro's command.
This command takes a 1280x1024 p picture from the webcam.
If prefer it smaller, try changing the -s parameter: qqvga is the tiniest, vga is 640x480, svga is 800x600 and so on.
Get your smile on and press enter! :)
http://www.joachim-breitner.de/projects#screen-message now also supports reading stdin continuously to update what it shows, different ?slides? separated by a form feed character. Here, we feed the current time into it each second to create a large clock.
this one works on user crontab
On CentOS at least, date returns a boolean for the common date string formats, including YYYY-MM-DD. In the sample output, you can see various invalid dates returning 0 whereas a simple regex check would return 1 for the invalid dates.
-d, --date=STRING display time described by STRING, not `now'
The version of date on OS X does not appear to have this same option.
pauses exactly long enough to wake at the top of the hour
Format of the response: [-]HH:mm