Redirecting bash output into any X Window

alias 2edit='xsel -b;n=pipe$RANDOM;xdotool exec --terminator -- mousepad $n -- search --sync --onlyvisible --name $n key --window %1 ctrl+v'
bash output is inserted into the clipboard, then mousepad is started and the clipboard content is pasted. xsel and xdotool needs to be installed. Instead of the mousepad any other editor can be used. I've successfully tested the Sublime Text Editor and it opens a new tab for each new paste. Check Sample output for a usage example. This command is originated from here -
Sample Output
dpkg -l | 2edit

By: ichbins
2013-08-11 06:18:31

What Others Think

Great info about X Windows, We are providing the best students assignment writing help and we are offering online law essay writing service UK and all type of essay at cheap price.
stephenhawking · 87 weeks and 6 days ago
I have just completed my studies in automotive mechanics. I would claim that this is a very complicated and very troublesome task for people who are to associate their lives with it. You are not going to learn in practice, but technically as normal. Many different design works and other stuff you will have to write. This is why it is helpful if I suggest that you come here at , the guys work really professionally here and know how and what they can do. You can contribute to any published work on any subject. By practice, I already suggest it. Good luck
Slaren · 71 weeks and 1 day ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: