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.
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:
Use this command to insert line numbers in source files, .' ' control how spaces you insert after number.
This command will squeeze all consequent blank lines (including those with only space and tab charactes) to one. It will also empty the resulting line (remove the "|s/.*//" part if you don't need that).
Check which files are opened by Firefox then sort by largest size (in MB). You can see all files opened by just replacing grep to "/". Useful if you'd like to debug and check which extensions or files are taking too much memory resources in Firefox.
this lets you edit a crontab file (which may be used as a backup as well) and insert this into your crontab. this way is especially handy, when multiple users are working on one account (e.g. root)
it is not work with Cygwin's bash3.X. Test in Linux.
use printf "%'f" number while it is floating point number
Very very cool list of quotations and directives on pythonic programming. I love them and they are sure applicable in C++ too, and for most any programming, really.
Tested with NTFS and found on this site:
http://forensicir.blogspot.com/2008/01/virtualbox-and-forensics-tools.html
The first 32256 bytes is the MBR
the command for the impatient sysadmin: simply checks every five secs, if a host or a specific service running on it is up. ideal for hosts that are configured not to respond on pings.
This will email [email protected] a message with the body: "rsync done" when there are no processes of rsync running. This can be changed for other uses by changing $(pgrep rsync) to something else, and echo "rsync done" | mailx [email protected] to another command.
Very helpful when you've got complex filenames and needs to change just some small parts of it.
Renaming a file called "i-made-a-small-typo-right-here" to "i-made-a-big-typo-right-here":
mv -vi i-made-a-{small,big}-typo-right-here
You could also copy multiple files, edit, remove, process, etc.
This will start a netcat process listening on port 666. If you are able connect to your your server, netcat will receive the data being sent and spit it out to the screen (it may look like random garbage, so you might want to redirect it to a file).
no external commands, but can only do 0-99, not 1-100, so we adjust it later