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:
Regular expression search pattern to remove the Datetime and Name when you paste from skype chat into your text editor
From this Gist:
Extracts domain and subdomain from given URl. See examples.
Extracts 2nd-level domain part (or 3rd level, for co.* or com.*) from the URI's hostname. See sample output.
Spits out table that shows your Host->HostName aliases in ~/.ssh/config
Leave out pygmentize or `pip install pygments` first.
Displays the number of processes per state
ssh from local to remote and pipe output of file to the local clipboard
3143 is the latest revision with a file
left-most column is PID, middle is virtual memory being consumed, right-most is actual process.
Periodically run the one-liner above if/when there are significant changes to the files in /usr/
= Before rebooting, add following to /etc/fstab : =
/squashed/usr/usr.sfs /squashed/usr/ro squashfs loop,ro 0 0
usr /usr aufs udba=reval,br:/squashed/usr/rw:/squashed/usr/ro 0 0
No need to delete original /usr/ ! (unless you don't care about recovery). Also AuFS does not work with XFS
Regnerate Exif thumbnail.
Cool alias that show a a better Git log
Works even with spaces in filenames.
As an alias in .gitconfig:
editchanged = "!git status --porcelain | sed -ne 's/^ M //p' | tr '\\n' '\\0' | tr -d '\"' | xargs -0 vim"
If you're using the experimental vorbis encoder (homebrew version of libffmpeg)
Tired of front end developers using short open tags in your views? This will replace all instances of
For mac users !
Searches Google, but requires no "", and will also search all terms input in the CL, eg:
> google foo bar
returns search URL "
You could also use awk to replace all spaces with a +, which is how the Google search handles spaces, but that makes it more than one line.