Results 1 to 4 of 4

Thread: How to redirect the command line output to the clipboard

  1. #1
    Join Date
    Jun 2008
    Location
    Xiamen
    Beans
    13
    Distro
    Ubuntu 8.04 Hardy Heron

    Question How to redirect the command line output to the clipboard

    Sometimes, I would like to post some topics on the forum, and the contents of the topics come from the output the command line output.

    Usually, I would run the command, and copy the output to the clipboard and then paste it here. I think it is a efficient less way to do the job and I am looking for if Bash has such kind of the feature.

  2. #2
    Join Date
    Apr 2008
    Location
    Australia
    Beans
    237
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to redirect the command line output to the clipboard

    Edit: Upon further investigation, xclip might be what you are after!
    I found this link: http://elcasey.wordpress.com/2008/02...-command-line/ which to me, sounds like what you're after.
    Last edited by matthew.ball; February 3rd, 2009 at 03:49 AM.

  3. #3
    Join Date
    Nov 2008
    Location
    San Gabriel Valley
    Beans
    263
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: How to redirect the command line output to the clipboard

    If you happen to use Thunar/Nautilus, here is the appropriate action using xclip:

    Code:
    echo -n %F | xclip -selection "clipboard"
    NetBSD 64-bit + Xfce
    ArchLinux 64-bit + JWM

  4. #4
    Join Date
    Jun 2008
    Location
    Xiamen
    Beans
    13
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: How to redirect the command line output to the clipboard

    It seems to be quite strange. According to the man page, I followed the example in the man page:

    uptime | xclip

    the redirected content went to the clipboard, if I want to use it in the X application, I just simply press the middle button of the mouse.

    While I tried your solution
    uptime | xclip -selection "clipboard"

    when I right clicked the mouse, the "paste" function in the pop-up menu is useless.

    puzzled, anyway, it solved my problem, thanks a lot

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •