commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Just a little simplification.
This will deal nicely with filenames containing newlines and will run one lzma process per CPU core. It requires GNU Parallel http://www.youtube.com/watch?v=OpaiGYxkSuQ
Really, you deserve whatever happens if you have a whitespace character in a file name, but this has a small safety net. The truly paranoid will use '-i'.
Essentially the same as funky's alias, but will not traverse filesystems and has nicer formatting.
Gnu grep allows to restrict the search to files only matching a given pattern. It also allows to exclude files.
I like this better than some of the alternatives using -exec, because if I want to change the string, it's right there at the end of the command line. That means less editing effort and more time to drink coffee.
The above output is for a custom compiled version of Vim on Arch Linux.
Just a quick shell one liner, and presents a list of all the enabled and disabled (those prefixed with a '-') features.
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.
Quicker way to search man pages of command for key word
A Quick variation to the latest commands list with the new-lines skipped. This is faster to read.
I use this sometimes when ctags won't help.
I've been using it in a script to build from scratch proxy servers.
I use zgrep because it also parses non gzip files.
With ls -tr, we parse logs in time order.
Greping the empty string just concatenates all logs, but you can also grep an IP, an URL...
This should do the same thing and is about 70 chars shorter.
The ^python$ is a package name patten. You can change whatever you want.
-P tells grep to use perl regex matches (only works on the GNU grep as far as I know.)
The cut should match the relevant timestamp part of the logfile, the uniq will count the number of occurrences during this time interval.