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:
Query the Socrata Open Data API being used by the White House to find any employee's salary using curl, grep and awk.
Change the value of the search parameter (example uses Axelrod) to the name of any White House staffer to see their annual salary.
A Quick variation to the latest commands list with the new-lines skipped. This is faster to read.
I've been using it in a script to build from scratch proxy servers.
'ac' is included in the package 'acct', which is described as "The GNU Accounting utilities for process and login accounting". Other interesting flags are:
* print statistics for a specified user
ac -d username
* print statistics for all the users
With my command, the output is also printed in a sexagesimal, more readable, style.
Validate a file using xmllint. If there are parser errors, edit the file in vim at the line of the first error.
No need for grep, let awk do the match. This will not behave properly if the filenames contains whitespace, which is awk's default field separator.
This should do the same thing and is about 70 chars shorter.
Emits the device names which will be printed by iostat for an LVM volume; doesn't show the names for the underlying devices when snapshots are being used (the -cow and -real devices in /dev/mapper)
Here's an awk version.
Counts TCP states from Netstat and displays in an ordered list.
Searches for web radio by submitted keyword and returns the station name and the link for listing .
May be enhanced to read user's selection and submit it to mplayer.
If you use HISTTIMEFORMAT environment e.g. timestamping typed commands, $(echo "1 2 $HISTTIMEFORMAT" | wc -w)
gives the number of columns that containing non-command parts per lines.
It should universify this command.
not the best, uses 4 pipes!
previous version leaves lots of blank lines
Case Insensitive! and Works even if the "<title>...</title>" spans over multiple line.
Grab a list of MP3s (with full path) out of Firefox's cache
Ever gone to a site that has an MP3 embedded into a pesky flash player, but no download link? Well, this one-liner will yank the *full path* of those tunes straight out of FF's cache in a clean list.
Shorter and Intuitive version of the command submitted by (TuxOtaku)
Interfaces like lo can be omitted from the beginning, there are probably better ways of doing this, i'm a noob at awk.
Ever gone to a site that has an MP3 embedded into a pesky flash player, but no download link? Well, this one-liner will yank the names of those tunes straight out of FF's cache in a nice, easy to read list. What you do with them after that is *ahem* no concern of mine. ;)
Yet another x11grab using ffmpeg. I also added mic input to the capturing video stream using alsa. Yet I need to find out how to capture audio which is currently playing.