Command of the Day

Casual and not-so-casual readers of this blog know I’m a Linux/Unix guy. I fire up the work peecee for e-mail; since moving to my new location a month ago, I don’t even do that anymore. My new cube has only one network connnection, and that is used by my Linux workstation, running a Gnome desktop and the Exchange web client for email. I am not hardcore enough to run a workstation in text mode; still, to me, windowing systems are merely facilities for opening multiple text windows.

It is handy to capture output from some text window and paste it into an email, or into some other file that I’m editing. Heretofore, I’d just use the mouse to select the text from one window, and the middle mouse button to paste it in. Yesterday I came across a neat little utility that promises to change this method. It’s called xclip; here’s its help screen:

Usage: xclip [OPTION] [FILE]…
Access an X server selection for reading or writing.

-i, -in read text into X selection from standard input or files
(default)
-o, -out prints the selection to standard out (generally for
piping to a file or program)
-l, -loops number of selection requests to wait for before exiting
-d, -display X display to connect to (eg localhost:0″)
-h, -help usage information
-selection selection to access (”primary”, “secondary”, “clipboard” or “buffer-cut”)
-noutf8 don’t treat text as utf-8, use old unicode
-version version information
-silent errors only, run in background (default)
-quiet run in foreground, show what’s happening
-verbose running commentary

So, to get that help screen into this post, I just typed
xclip -h 2>&1 | xclip
I then used the middle mouse button to paste the stuff. No more grabbing one line too many, one line too few, etc. Precision. I like that.

Little utilities like this fascinate me. There’s room in my toolbox for xclip.

-k-

One Comment

  1. Posted October 26, 2008 at 10:52 pm | Permalink

    Hey, that’s really cool! Thanks for the hint!

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*