Commands by jeffskinnerbox (4)

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. 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.

Share Your Commands


Check These Out

Copy ssh keys to user@host to enable password-less ssh logins.
Alternative for machines without ssh-copy-id

Empty a file
For when you want to flush all content from a file without removing it (hat-tip to Marc Kilgus).

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Get the dir listing of an executable without knowing its location

Find common groups between two users
Updated according to flatcap's suggestion, thanks!

Validate all XML files in the current directory and below
If everything validates, there's no output. Can be handy to run on a cron job set up to email output.

Route outbound SMTP connections through a addtional IP address rather than your primary

For Gentoo users : helping with USE / emerge
This command puts all the flags of the USE variable actually used by the packages you emerged to the file "use", and those which are unused but available to the file "notuse"

Matrix Style
Solves "tr" issues with non C-locales under BSD-like systems (like OS X)

move you up one directory quickly
In bash, this turns on auto cd. If a command is just a directory name, it cd's into that directory.


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: