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:
"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
SImply type "cd" and press enter
-t option tells the system to look for a msdos filesystem
The /dev/fd0 is your floppy drive ( This may be different for you check /dev folder to confirm)
/mnt/floppy is the point where you want to mount the device to
repeat a command every X seconds , output show the creation of partition image using fsarchiver, each line show the size of the image.
Kills all processes owned by user MYWIFE (replace MYWIFE with username or ID of your choice)
(Thanks, porges, for the better command)
Run GUI apps on another machine remotely through SSH.
-C is for data compression and -X enables X11 forwarding.
Take a folder full of files and split it into smaller folders containing a maximum number of files. In this case, 100 files per directory.
find creates the list of files
xargs breaks up the list into groups of 100
for each group, create a directory and copy in the files
Note: This command won't work if there is whitespace in the filenames (but then again, neither do the alternative commands :-)
With a lolcat favicon if you access it from your browser
rename command in my system -Fuduntu running 2.6.38 Linux Kernel- is an ELF 64-bit LSB executable, not a Perl script. man page for rename command shows syntax as "rename from to where" (or something like that), so I am doing just what I have been told...
echo "ls" > script.bash;
This is my script, a simple 'ls'.
gpg -c script.bash;
Here I encrypt and passord-protect my script. This creates file script.bash.gpg.
cat script.bash.gpg | gpg -d --no-mdc-warning | bash
Here I open file script.bash.gpg, decrypt it and execute it.