linux copy to clipboard

| categories: alias, workflow, osx, linux | View Comments

Is it true that you have to give names to things to really appreciate and understand them? It's really one of these questions that are just too gross for answering a straight yes or no.

When you think of this question, math comes to mind. I have little doubt that you must internalize dozens of definitions and the relations between them before you master differential geometry, or group theory. But do you need language to understand subtraction? The answer is - NO . Babies do it intuitively. So there is some border beyond which things become too abstract, and we've got to give them names. But isn't my answer a tautology? Isn't "abstract" just the name of this phenomena of having to name something in order to understand it? Sure enough, if we were not so used to giving names to everything, we would have found lots of things "abstract". Helen Keller writes :

"my teacher placed my hand under the spout. As the cool stream gushed over one hand she spelled into the other the word water, first slowly, then rapidly. I stood still, my whole attention fixed upon the motions of her fingers. Suddenly I felt a misty consciousness as of something forgotten - a thrill of returning thought; and somehow the mystery of language was revealed to me. I knew then that "w-a-t-e-r" meant the wonderful cool something that was flowing over my hand"

Most of us don't think of the notion of water as abstract, but it's just a matter of experience.

SO… It didn't occur to me that I need to copy linux outputs to the clipboard, until I found out about xclip (keep your comments about the long intro to yourself, by the way…). Now that I know about it, I also care about cases where I want the trailing '\n', and cases where I don't.

Here are my aliases for linux:

1: alias xc='xclip -selection clipboard'
2: alias xcn='perl -ne "chomp();print" |xclip -selection clipboard'

And here they are for mac osx :

1: alias xc="pbcopy"
2: alias xcn="tr -d '\n' | pbcopy"

The two approaches for removing the newlines work equivalently on both systems.

Copyright (C) 2015 by Avi Gozolchiani. See the License for information about copying.

org-mode source

Read and Post Comments