This question already has an answer here:
Let's say I have an alias on my system which I often use to tell me my system information, the alias is
systeminfo, and it executes
lsb_release -a which outputs:
No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 15.04 Release: 15.04 Codename: vivid
Now because I use this very often, and I then copy and paste the information into my AskUbuntu questions, it would be very useful if upon execution of the command, for the output to not only be printed to the Terminal window, but also be copied to my system clipboard, so that I can save time, and not need to select the text and then copy and paste that here. So I was wondering how that could be achieved? How do I make it so that not only is it printed on screen, but also copied to the system clipboard? Preferably, I would like this question to be answered with a script which asks me if I want the information to be copied to my system clipboard in addition to being displayed on screen, but I can of course write up that script, so it would just be for convenience and to save time.
I have tried these, but they don't work for me: