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.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
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:
make usable on OSX with filenames containing spaces. note: will still break if filenames contain newlines... possible, but who does that?!
It doesn't save your notes, but it's great for jotting something down quickly.
this bash command sets it so that when you type "screen ", it searches your running screens, and present valid auto-complete choices. The output is .
Note: You must have programmable completion enabled. Check with "shopt progcomp", set with "shopt -s progcomp"
I know how hard it is to find an old command running through all the files because you couldn't remember for your life what it was. Heres the solution!! Grep the history for it. depending on how old the command you can head or tail or if you wanted to search all because you cannot think how long ago it was then miss out the middle part of the command. This is a very easy and effective way to find that command you are looking for.
If you want to delete lines fast then all you need to do is vi/vim a text file, type in the amount of lines you want to delete (in my example I wanted to delete 10056 lines) followed by dd (no spaces). There will be no output so becareful with what number you type.
remove old index.html if you download it again and organiaz the java script tag on the file index.html
Why use many different utilities all piped together, when you only need two?
This command will ask for remote sudo password before executing a remote command.
Output contains also garbage (text parts from netstat's output) but it's good enough for quick check who's overloading your server.
After installing Termbeamer (see termbeamer.com) you can use it to share a terminal session with one or more others even from behind a firewall or NAT.
Make sure the file you use in your test is > 50mb to get good results.
Dependancies:
sudo apt-get install lftp iperf
This command will install phpmyadmin, set apache2 server and restart apache2. After running this command you can open phpmyadmin on http://yoursite.com/phpmyadmin
Remove security restrictions from PDF documents using this very simple command on Linux and OSX. You need QPDF installed (http://qpdf.sourceforge.net/) for this to work.
Dump all the tweets with the keyword "obama" or "barack", in json format, to a file.
If you want you can provide the password directly on the line:
curl -s -u $USERNAME:$PASSWORD -X POST -d "track=obama,barack" https://stream.twitter.com/1.1/statuses/filter.json -o twitter-stream.out