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:
'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.
This makes an alias for a command named 'busy'. The 'busy' command opens a random file in /usr/include to a random line with vim. Drop this in your .bash_aliases and make sure that file is initialized in your .bashrc.
Computes a columns average in a file. Input parameters = column number and optional pattern.
This version prints current votes and commands for a user. Pass the user as an argument. While this technically "fits" as a one liner, it really is easier to look at as a shell script with extra whitespace. :)
(Apparently it is too long so I put it in sample output, I hope that is OK.)
Run the long command (or put it in your .bashrc) in sample output then run:
fbemailscraper YourFBEmail Password
Voila! Your contacts' emails will appear.
Facebook seems to have gotten rid of the picture encoding of emails and replaced it with a text based version making it easy to scrape!
Needs curl to run and it was made pretty quickly so there might be bugs.