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:
Somehow, i prefer forcing to rm interactively to accidently rm'ing everything...
Modify all files newer than another file and touch them to a specific date.
I simply find binary notation more straightforward to use than octal in this case.
Obviously it is overkill if you just 600 or 700 all of your files...
You could avoid xargs and sed in this case (shorter command and less forking): At least bash and zsh have some mighty string modifiers.
I would also suggest using find with exec option to get more flexibility. You may leave out or include "special" file for example.
creates 100 directories f(1-100) with a file in each matched to the directory (/f1/myfile1, .. /f98/myfile98,/f99/myfile99/,/f100/myfile100,etc )
Use the command to create a script and bind it to a key using keyboard shortcut.
eg:
Script locks the screen in a loop until the command is executed again.At first it
Example above will recursively find files in current directory created/modified in 2010.
Forces the -i flag on the rm command when using a wildcard delete.
This will create, in the current directory, a file called 'pk.pem' containing an unencrypted 2048-bit RSA private key and a file called 'cert.pem' containing a certificate signed by 'pk.pem'. The private key file will have mode 600.
!!ATTENTION!! ==> this command will overwrite both files if present.
Increase the modification date for the files selected with the find command.
This is great for looking for files that have been updated recently. Logs especially or monitoring what files were added during an install.
Thanks th John_W for suggesting the fix allowing ~/ to be used when saving a directory.
directions:
Type in a url, it will show a preview of what the file will look like when saved, then asks if you want to save the preview and where you want to save it. Great for grabbing the latest commandlinefu commands without a full web browser or even a GUI. Requires: w3m
touch a dummy file with the specified date, then use find with -anewer .