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.

Universal configuration monitoring and system of record for IT.

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



Psst. Open beta.

Wow, didn't really expect you to read this far down. The latest iteration of the site is in open beta. It's a gentle open beta-- not in prime-time just yet. It's being hosted over at UpGuard (link) and you are more than welcome to give it a shot. Couple things:

  • » The open beta is running a copy of the database that will not carry over to the final version. Don't post anything you don't mind losing.
  • » If you wish to use your user account, you will probably need to reset your password.
Your feedback is appreciated via the form on the beta page. Thanks! -Jon & CLFU Team

Start an X app remotely

Terminal - Start an X app remotely
ssh -f [email protected] DISPLAY=:0.0 smplayer movie.avi
2009-09-12 22:16:59
User: Escher
Functions: ssh
Start an X app remotely

Launch a gui app remotely. In this example smplayer is installed on the remote machine, and movie.avi is in the remote user's home dir. Note that stdout/stderr is still local, so you'll have feedback locally, add '&>/dev/null' to suppress. This is surprisingly not well known (compared to running an X app locally via ssh -X). (NB. if your distro requires ~/.Xauthority file present, then try -fX if you have problems)

Resubmitted (and trimmed, thanks sitaram) due to ridiculous voting on previous submission. Fingers crossed, it gets a better rating this time.


There are 3 alternatives - vote for the best!

Terminal - Alternatives

Know a better way?

If you can do better, submit your command here.

What others think

++ :-)

Comment by sitaram 406 weeks ago

Good point about the Xauthority thing -- I used to have to set it along with the DISPLAY earlier but now it seems to just work; didn't investigate why...

For those who are thinking "why would I want to do that", here're a couple of examples:

- when my kids were younger, it was fun to send them popup messages. Maybe a joke or a riddle. They have no clue how it popped up. I once got my nephew to start on his homework by saying "[his name], this is [teacher's name]; please start on your homework right NOW". Hilarious! And effective too.

- my dad lives a 12-hour train journey away, so on the rare occasion he calls and says "this isn't working" or "how do I...", it's useful to log in, grab a screenshot of his screen using xwd and bring that file across, then take a look at it and tell him what he's doing wrong. This is easy enough/fast enough for occasional use, though I agree a true remote desktop/vnc type thing would be better for more sustained use

Comment by sitaram 406 weeks ago

I think the modern distros use a database for Xauthority (eg gdm login uses /var/run/gdm/auth-for-user-abc123/database, so even if you rm ~./Xauthority your xapps still work. But I can't work out the consistent behaviour across distros.

Comment by Escher 405 weeks and 6 days ago

What is the reason for not just using ssh -X (or ssh -Y) ?

Comment by peshay 405 weeks and 5 days ago

ssh -X enables Xforwarding to the local display (by setting DISPLAY=localhost:10.0) not the remote display. It also creates the ~./Xauthority cookie, whichIi originally thought was needed, but doesn't seem necessary in modern distros.

Comment by Escher 405 weeks and 4 days ago

I just use mplayer -display :0 movie.avi to display on the remote machine

Comment by cizu 386 weeks and 4 days ago

Soooo many times I have been laying in bed wanting play another video and not have to get up. Now I can just use my little netbook using this command (and cizu's as well).


Comment by whit2333 234 weeks and 6 days ago

Your point of view

You must be signed in to comment.