Skip to content

Instantly share code, notes, and snippets.

@YumaInaura
Last active August 28, 2018 03:12
Show Gist options
  • Save YumaInaura/264939fb67eaf5409c6bef3cc6436b79 to your computer and use it in GitHub Desktop.
Save YumaInaura/264939fb67eaf5409c6bef3cc6436b79 to your computer and use it in GitHub Desktop.
Shell - Clip board copy from console output ( Not STDOUT … tty)

Shell - Clip board copy from console output ( Not STDOUT … tty)

How to copy to clipboard from Console outputs? Include STOUT but not reduced with it.

For example how to copy command not command result? ( in bellow case $ echo OK )

$ echo OK
OK

Answer

Use OS Software's feature.

You can use clipboad copy even it was a bash or sh or zsh or docker container or others work in your console.

iTerm2 case in Mac OS

Start copy mode with Command+Shift+C

image

You can use VIM keystrokes include arrow keys.

image

  • Start copy with Control+Space
  • Select copy area
  • y to yank (copy)

image

Now you can paste

image

Help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment