LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 02-02-2009, 08:57 PM   #1
kejing
LQ Newbie
 
Registered: Dec 2008
Location: Xiamen, China
Distribution: Ubuntu 8.04
Posts: 5

Rep: Reputation: 0
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.
 
Old 02-03-2009, 01:21 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950
Use xsel or xclip.

For example, highlight some text and then run:

xsel -o | xsel -i -b

This will copy the contents of the highlight buffer straight to the clipboard. You can create an alias or button shortcut for it if you use it often.
 
  


Reply

Tags
cli, redirect


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clear clipboard via command line? Wynd Linux - General 4 02-04-2010 12:26 AM
How to redirect the output of exec command output in perl? sudhap85 Linux - Newbie 3 08-28-2009 04:35 PM
LXer: Language translation from the command line or clipboard LXer Syndicated Linux News 0 04-04-2008 03:50 PM
how to redirect the output of find command to input of egrep babu198649 Linux - Newbie 2 12-27-2007 04:50 AM
Command output to clipboard sami Linux - Newbie 2 02-23-2004 03:05 AM


All times are GMT -5. The time now is 04:18 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration