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:
use it to stagger cronjob or to get a random number
increase the range by replacing 100 with your own max value
This command is useful for searching through a whole folder worth of pdf files.
Creates a git repository in a predefined location.
git gc should be run on all git repositories every 100 commits. This will help do do so if you have many git repositories ;-)
How much memory is chrome sucking?
Well, this is quite useful for testing if your hardware watchdog is working properly.
POSIX compliant arithmetic evaluation.
list all java process info.
Replace the first part of the command above with the appropriate timezone string. Eg: 'Europe/London' or for UTC - 'Etc/UTC'. The appropriate string can be found from https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
This is useful when your server is installed by a data centre (managed hardware, VPS, etc) and the timezone is not usually set to the one your prefer.
Shows a list of all installed cows saying a fortune. Also lists the cows names. Pic your favorite cow!
Needs cowsay, fortune and ruby installed. The path only applies to OS X with cowsay installed using homebrew. On Linux it might be /usr/share/cowsay/cows/ or similar. Uses ruby just because.
Anyone can make the command smaller & easier? :)
I have found that base64 encoded webshells and the like contain lots of data but hardly any newlines due to the formatting of their payloads. Checking the "width" will not catch everything, but then again, this is a fuzzy problem that relies on broad generalizations and heuristics that are never going to be perfect.
What I have done is set an arbitrary threshold (200 for example) and compare the values that are produced by this script, only displaying those above the threshold. One webshell I tested this on scored 5000+ so I know it works for at least one piece of malware.
Put it in your ~/.bashrc
google word1 word2 word3...
google '"this search gets quoted"'
I found this command on a different site and thought you guy might enjoy it. Just change "YOURSEARCH" to what ever you want to search. Example, "Linux Commands"
This is longer than others on here. The reason for this is I have combined two different matrix commands so it would work on all computers. I logged onto my server through a computer and it worked fine. I logged into my server through a mac and it looked $4!t so I have made one that works through both.