What's this?

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.

Get involved!

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.

UpGuard checks and validates configurations for every major OS, network device, and cloud provider.

Stay in the loop…

Follow the Tweets.

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

Subscribe to the feeds.

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:



May 19, 2015 - A Look At The New Commandlinefu
I've put together a short writeup on what kind of newness you can expect from the next iteration of clfu. Check it out here.
March 2, 2015 - New Management
I'm Jon, I'll be maintaining and improving clfu. Thanks to David for building such a great resource!

Top Tags



Commands by rpavlick from sorted by
Terminal - Commands by rpavlick - 15 results
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
sudo iptables -L -nv
lsof -n | grep /media/cdrom
find . \( -type d -empty \) -and \( -not -regex ./\.git.* \) -exec touch {}/.gitignore \;
sed 's/^[ \t]*//' input.txt
chmod --reference file1 file2
2010-03-31 12:05:48
User: rpavlick
Functions: chmod
Tags: chmod chown chgrp

Also works with:

chgrp --reference file1 file2 chown --reference file1 file2
sudo date -s "$(ssh [email protected] "date -u")"
2010-03-31 11:59:27
User: rpavlick
Functions: date sudo
Tags: sudo

(Useful when firewalls prevent you from using NTP.)

echo 'ServerAliveInterval 60' >> /etc/ssh/ssh_config
2010-03-31 09:22:54
User: rpavlick
Functions: echo
Tags: ssh timeout

ssh_config is the system-wide configuration file for ssh.

For per-user configuration, which allows for different settings for each host:

echo 'ServerAliveInterval 60' >> ~/.ssh/ssh_config


echo 'ServerAliveInterval 60' >> ~/.ssh/config


echo 'ServerAliveInterval 60' >> ~/etc/ssh_config
defaults write /Library/Preferences/com.apple.loginwindow DesktopPicture "/System/Library/CoreServices/Finder.app/Contents/Resources/vortex.png"
2010-03-30 22:52:19
User: rpavlick
Functions: write
Tags: terminal osx

Change the file location in the second half of the string to the exact file location of your chosen picture.

defaults write com.apple.dashboard devmode YES
2010-03-30 22:50:27
User: rpavlick
Functions: write
Tags: osx dashboard

Enables widgets to be placed onto the desktop. Click and hold the widget and press F12 to drag it onto the desktop. Repeat the process again to drag a widget back onto the dashboard. You may need to log off or restart for it to take effect.

dd bs=1k if=image.nrg of=image.iso skip=300
2010-03-30 22:07:58
User: rpavlick
Functions: dd
Tags: dd iso nero

This line removes the 300k header from a Nero image file converting it to ISO format

hdiutil convert /path/imagefile.iso -format UDRW -o /path/convertedimage.dmg
hdiutil convert /path/imagefile.dmg -format UDTO -o /path/convertedimage.iso
sudo ifconfig en1 ether 00:e2:e3:e4:e5:e6
2010-03-30 21:48:55
User: rpavlick
Functions: ifconfig sudo

If you want to check that the spoof worked, type the same command as earlier:

ifconfig en1 | grep ether

Now you will see:

ether 00:e2:e3:e4:e5:e6

For the wired ethernet port:

sudo ifconfig en0 ether 00:e2:e3:e4:e5:e6