Red M
Red M

Reputation: 2799

Copy MAC terminal output to my clipboard without mouse but by using shortcut from keyboard

I have the following:

enter image description here

After typing (pwd),
how can I copy my terminal output (/sdcard/Android/data) using my keyboard and not another command or my mouse?

NOTE: I looked online but I only found ways on how to copy the last output using another command which makes it even more tedious since using a mouse will be faster.

Upvotes: 3

Views: 1758

Answers (1)

cello
cello

Reputation: 5486

macOS contains two terminal commands dealing with the clipboard: pbcopy and pbpaste (for whatever reason they use the term pasteboard instead of clipboard). You can just pipe content into pbcopy or out of pbpaste to copy or paste from the clipboard.

To copy the current working directory, as in your example, you would write:

$ pwd | pbcopy

EDIT: okay, just saw the requirement to copy it with the keyboard, and not with another command… So ignore my answer, will probably delete it soon.

Upvotes: 3

Related Questions