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:
Random Cyanide and Happiness comics from explosm.net. I use this command http://www.commandlinefu.com/commands/view/3477/random-xkcd-comic and update it for explosm.net
--edit : modification for *.jpeg files + guest authors
This command produces the output of "du -sk testfile" in every 10 seconds. You can change the command to be whatever you want.
The magic is performed by the parameter -t
I had a file named " " (one space) and needed a way to see what the real filename was so I could remove it. sed to the rescue.
Run program as root by SSH key forwarding instead of sudoers.
Put this alias line in .bashrc or wherever you like. Alias arguments might need extra escaping.
You might wonder about security. But you'd block out root login as much as possible of course. In sshd_config you put this:
Match Address 127.0.0.1
xinit $(which gnome-awesome-session)
with cat /usr/local/bin/gnome-awesome-session:
exec gnome-session --session awesome "$@"
note: in ubuntu 12.10 a probable Xephyr recent bug rejects keybd option ...
Resize all png in the current folder.
Warning: no copy. Make sure you have a copy of the originals
Every 20 minutes ping host with IP address 192.168.0.14. If it's not 'alive' or not reachable, then display something eye-catching (here xeyes) on the desktop.
Hint for newbies: edit crontab with
.daa is a non-standard disk image format that can not be read by any other program. This is how you can extract the files though.
PowerISO binary for Linux: http://www.poweriso.com/poweriso-1.3.tar.gz
"This is a free utility for linux which can extract, list, and convert image files (including ISO, BIN, DAA, and other formats). Type " poweriso -? " for detailed usage information. File Size: 278KB"
Scan for viruses, recursively and print only infected files, with bell sound. Clamscan is part of clamav package. Tested on Debian.
Undo (sh, bash, tcsh)
"That's it. Not much to see here. The first command writes any cache data that hasn't been written to the disk out to the disk. The second command tells the kernel to drop what's cached. Not much to it. This invalidates the write cache as well as the read cache, which is why we have the sync command first. Supposedly, it is possible to have some cached write data never make it to disk, so use it with caution, and NEVER do it on a production server. You could ... but why take the risk?
As long as you are running a post 2.6.16 kernel,..."
This is a little trickier than finding the last Sunday, because you know the last Sunday is in the first position of the last line. The trick is to use the NF less than or equal to 7 so it picks up all the lines then grep out any empty lines.
simple way to show free swap
trying to copy all your dotfiles from one location to another, this may help
Currently Facebook has updated their headers to display 127.0.0.1 but if you have saved e-mails from messages and FB related mail you can still reveal the IP. :)
Tested on Mac OS X 10.6.3