xenial (1) yank-cli.1.gz

Provided by: yank_0.6.2-1_amd64 bug

NAME

     yank — yank terminal output to clipboard

SYNOPSIS

     yank [-lx | -v] [-d delim] [-g pattern [-i]] [-- command [argument ...]]

DESCRIPTION

     Read input from stdin and display a selection interface that allows a field to be selected and copied to
     the clipboard. Fields are either recognized by a regular expression using the -g option or by splitting the
     input on a delimiter sequence using the -d option, see DELIMITERS.

     Using the arrow keys will move the selected field. The interface support several Emacs like key bindings,
     see COMMANDS.  Pressing the return key will invoke the yank command and write the selected field to the its
     stdin.  The yank command defaults to xsel(1) but could be anything that accepts input on stdin.  When
     invoking yank everything supplied after the -- option will be used as the yank command, see EXAMPLES.

OPTIONS

     -d delim
              all input characters not present in delim will be recognized as fields, see DELIMITERS

     -g pattern
              use the regular expression pattern to recognize fields expressed as a to POSIX extended regular
              expression

     -i       ignore case differences between pattern and the input

     -l       use the default delimiters except for space, see DELIMITERS

     -v       prints version

     -x       use alternate screen

     -- command [argument ...]
              use command with zero or more argument as the yank command

COMMANDS

     Ctrl-A   move selection to the first field

     Ctrl-C   exit without invoking the yank command

     Ctrl-E   move selection to the last field

     Ctrl-N or Right
              move selection to the right

     Ctrl-P or Left
              move selection to the left

     Down     move selection to the next line

     Up       move selection to the previous line

     Enter    exit using the selected field

DELIMITERS

     If the -d and -g options are omitted the following characters are recognized as delimiters by default:

     \f       form feed

     \n       new line

     \r       carriage return

     \s       space

     \t       horizontal tab
     If the -d option is present space is not recognized as a delimiter.

EXAMPLES

     Yank a environment variable key or value:

           env | yank -d =

     Yank a field from a CSV file:

           yank -d \", <file.csv

     Yank a whole line using the -l option:

           make 2>&1 | yank -l

     If stdout is not a terminal the selected field will be written to stdout and exit without invoking the yank
     command. Kill the selected PID:

           ps ux | yank -g [0-9]+ | xargs kill

     Yank the selected field to the clipboard as opposed of the default primary clipboard:

           yank -- xsel -b

DIAGNOSTICS

     The yank utility exits 0 on success, and >0 if an error occurs.

SEE ALSO

     re_format(7)

AUTHORS

     Anton Lindqvist <anton.lindqvist@gmail.com>