LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 07: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, 12:21 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
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



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-03-2010 11:26 PM
How to redirect the output of exec command output in perl? sudhap85 Linux - Newbie 3 08-28-2009 03:35 PM
LXer: Language translation from the command line or clipboard LXer Syndicated Linux News 0 04-04-2008 02:50 PM
how to redirect the output of find command to input of egrep babu198649 Linux - Newbie 2 12-27-2007 03:50 AM
Command output to clipboard sami Linux - Newbie 2 02-23-2004 02:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:17 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration