I am often having to copy and paste text from the terminal. Is there a way to redirect the output of a command into a shell variable or another command that would place the output in the clipboard?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
pbcopyandpbpaste. Anything sent topbcopygoes into the clipboard. Runningpbpastesends the contents of the clipboard to standard output and you can chain them just like all other commands.You can find some example uses here: http://osxdaily.com/2007/03/05/manipulating-the-clipboard-from-the-command-line/