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:
Should run on any system with ssh installed.
Watch is a very useful command for periodically running another command - in this using mysqladmin to display the processlist. This is useful for monitoring which queries are causing your server to clog up.
This command will remove all .svn folder from your project if you need to manual remove the subversion files.
If you have the library installed ntfs-3g, you will be able to mount the windows partition and write on it....
if the command is successful , you will get no output - only if an error has occurred will there be output
Note the g for global in the perl expression; without it, only the first occurrence in the name would be replaced.
uses tar to dump files from /orignl/path to /dst/dir. i find tar's out more readable than cp, and it doesn't mess with modified dates.
burn all those sweet iso's from the command line. replace speed=2 with more if your media supports it and you're brave!
This will check all .HTML file contents for the word "Hacked" and dump it to hacklog.txt. This is great for located all those files affected by nasty Joomla exploits. Change the .HTML to any other extension you wish to check, and of course the word "HACKED" for other searches.
This will tell you who has the most Apache connections by IP (replace IPHERE with the actual IP you wish to check). Or if you wish, remove | grep -c IPHERE for the full list.
List top 20 IP from which TCP connection is in SYN_RECV state.
Useful on web servers to detect a syn flood attack.
Replace SYN_ with ESTA to find established connections
run as root and use it fo find file you're looking for.
This command is useful when you want to know what process is responsible for a certain GUI application and what command you need to issue to launch it in terminal.
Copies whatever is piped to the pbcopy command to the clipboard.
pbpaste ... well pastes whats on the clipboard.
when I turn on my wifi, I always have to put in this command in order to make my laptop notice the wifi.
Creates a database that could then be populated with a dump file or application.
Where "docname" is the document you want OS-X to image... file.txt, file.pdf, file.mov, etc
Just another curl command to get your public facing IP
Original author unknown (I believe off of a wifi hacking forum).
Used in conjuction with ifconfig and cron.. can be handy (especially spoofing AP's)