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:
when editing .bash_profile (or .bashrc), run this to use the new version without having to exit and open a new terminal
Note you have also the --xml option ;)
defines a handy function for quick calculations from cli.
Useful if non-ascii characters in filenames have been improperly encoded. Replace "PROBLEM" with the incorrect characters (e.g. 'é'), and "FIX" with the correct ones (e.g. '?').
This command will replace all the spaces in all the filenames of the current directory with underscores. There are other commands that do this here, but this one is the easiest and shortest.
Found it on snipt, pok3, is it yours?
I put my user = m33600, the password and the status was my robot message:
Settima robot message: ALARM ZONE 3 (sent via command line).
Now bots may have their identity on twitter...
Skype has an internal regex which depicts the emoticons it supports. However you cannot simply search the binary file for it. This small 181 character line will do just that, provided skype is running. And of course, only works in linux.
Use this if you don't have access to GNU grep's -B option.
Don't have GNU tar installed that supports the redirect option (-C)? Use this.
Oracle DBA remove some logfiles which are still open by the database and he is complaining the space has not been reclaimed? Use the above command to find out what PID needs to be stopped. Or alternatively recover the file via:
cp /proc/pid/fd/filehandle /new/file.txt
Type this into windows via run and it will display to you your complete policy for windows. This includes group policy, security policy and your active directory account (min password etc)....
When plumbers use pipes, they sometimes need a T-joint. The Unix equivalent to this is 'tee'. The -a flag tells 'tee' to append to the file, rather than clobbering it.
Tested on bash and tcsh.
Using perl, here, we grep the man page of fetchmail to find the paragraph starting with '-k | --keep' and ending before the paragraph starting with '-K | --nokeep'
Set an alarm to starts in specific time.
Sleep 5h and plays the song as a wake up alarm
merge a.pdf b.pdf and c.pdf and create ./out.pdf
I've used this scan to sucessfully find many rogue APs on a very, very large network.