Generate a truly random password using noise from your microphone to seed the RNG. This will spit out 12 password with 12 characters each, but you can save this into a bash script and replace 'pwgen -ys 12 12' with 'pwgen $@' so you can pass any paramters to pwgen as you would normally do. Show Sample Output
Cleans apt-get and gpg cache and keys
This lists all files modified after calling some command using a temporal anchor.
remove all compressed files in /home/ folder not created in the last 10 days
Copy data to the destination using commands such as cpio (recommended), tar, rsync, ufsdump, or ufsrestore. Example: Let the source directory be /source, and let the destination directory be /destination. # cd /source # cd .. # find ./source -depth -print | cpio -cvo> /destination/source_data.cpio # cd /destination # cpio -icvmdI ./source_data.cpio # rm -rf ./source_data.cpio
If you need to delete all redundant ".svn" directories from a given path and all its subdirectories, use this command ! Particulary useful if you want to upload to an ftp server, but don't use svn or if you need to update/backup some source code to another directory. You can also try "svn export . /new/path/without/svn/dirs" (also from the CLI)
If (when) you forget to "svn rm" files from your repository, use this to let your repository know you want those files gone. Of course this works with adding and reverting too.
For all of the jpgs in a directory, determine their size and if below a threshold remove them forcefully.
This function is used to sort selected lines of a text file to the end of that file. Especially useful in cases where human intervention is necessary to sort out parts of a file. Let's say that you have a text file which contains the words rough slimy red fluff dough For whatever reason, you want to sort all words rhyming with 'tough' to the bottom of the file, and all words denoting colors to the top, while keeping the order of the rest of the file intact. '$EDITOR' will open, showing all of the lines in the given file, numbered with '0' padding. Adding a '~' to the beginning of the line will cause the line to sort to the end of the file, adding '!' will cause it to sort to the beginning. Show Sample Output
Delete all files that its size it's different than 0 and older than actuall day.
Kills all process that belongs to the user that runs it - excluding bash, sshd (so putty/ssh session will be spared). The bit that says grep -vE "..." can be extended to include ps line patterns that you want to spare. If no process can be found on the hitlist, it will print # NOTHING TO KILL. Otherwise, it will print # KILL EM ALL, with the cull list.
a simple command in order to make iptables rules permanent, run @ sudo!
Bash method to remove all files but "abc". It would be 'rm *~abc' in Zsh.
commandlinefu.com is the place to record those command-line gems that you return to again and again. 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.
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: