The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Command line clipboard access

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Paul Gross

Posts: 152
Nickname: pgross
Registered: Sep, 2007

Paul Gross is a software developer for ThoughtWorks.
Command line clipboard access Posted: Jan 11, 2008 10:29 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Paul Gross.
Original Post: Command line clipboard access
Feed Title: Paul Gross's Blog - Home
Feed URL: http://feeds.feedburner.com/pgrs
Feed Description: Posts mainly about ruby on rails.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Paul Gross
Latest Posts From Paul Gross's Blog - Home

Advertisement

It is possible to control the clipboard (copy and paste) from the command line in linux and OSX. In linux, the command is xsel, and in OSX, pbcopy/pbpaste.

For example, someone IMed me and asked for a subversion URL. Normally, I would type “svn info” in a terminal, use the mouse to select the URL, and press Ctrl-Insert to copy. Instead, I can just run this command:

svn info | grep URL | xsel --clipboard

Then, I can Alt-Tab back to the IM window and press Ctrl-v. There is no wasted time reaching for the mouse.

The—clipboard argument is required. Without it, xsel acts on the currently selected text in the terminal rather then the clipboard.

In OSX, the equivalent command is:

svn info | grep URL | pbcopy

pbcopy/pbpaste come with OSX. In debian flavors of linux, the following command will install xsel:

sudo apt-get install xsel

xsel can also be used to paste the clipboard. For example:

% echo ls | xsel --clipboard

% xsel --clipboard
ls

% `xsel --clipboard`
bin    dev   initrd      lost+found    mnt   root  sys  var

Read: Command line clipboard access

Topic: How To: Tutorial on developing a Facebook application using Ruby on Rails (Part I) Previous Topic   Next Topic Topic: Mcirosoft Office 2008 for Mac / OS X

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use