YANK(1)
okay bestie, welcome to YANK(1) from the General Commands Manual โ the page for yank, aka the command that yanks terminal output to your clipboard. ๐โจ
๐ธ NAME ๐ธ
yank โ yank terminal output to clipboard. That's literally the whole vibe. ๐
โจ SYNOPSIS โจ
yank [-1ilxv] [-d delim] [-g pattern] [-- command [argument ...]]
๐ฆ DESCRIPTION ๐ฆ
Okay so here's the tea: yank reads input from stdin and shows you a selection interface where a field can be selected and copied to the clipboard. Fields are recognized either by a regular expression using the -g option, or by splitting the input on a delimiter sequence using the -d option โ see โDELIMITERSโ for the deets. ๐
Using the arrow keys will move the selected field โ see โCOMMANDSโ for the full menu. Pressing the return key will invoke command and write the selected field to its stdin. The command defaults to xsel, but bestie it could be anything that accepts input on stdin โ see โEXAMPLESโ. ๐ซถ
The options are as follows:
๐ OPTIONS ๐
-1โ If only one field is recognized, select it and invokecommandwithout displaying the selection interface.-ddelim โ All input characters not present in delim will be recognized as fields, see โDELIMITERSโ.-gpattern โ Use pattern to recognize fields, expressed as a 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 ...] โ Usecommandwith zero or more args as the yank command.
๐ฎ COMMANDS ๐ฎ
Ctrl-A|gโ Move selection to the first field.Ctrl-C|Ctrl-Dโ Exit without invoking the yank command.Ctrl-E|Gโ Move selection to the last field.Ctrl-P/Ctrl-N|Left/Right|h/lโ Move selection to the left or right.Ctrl-Lโ Toggle between current and line delimiter, equivalent to the-loption.Up/Down|j/kโ Move selection to the next or 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
Heads up bestie: if the -d option is present, space is not recognized as a delimiter. ๐
๐ EXAMPLES ๐
Yank an 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 instead of the default primary clipboard:
$ yank โ xsel -b
๐ DIAGNOSTICS ๐
The yank utility exits 0 on success, and >0 if an error occurs. Periodt.
๐ SEE ALSO ๐
๐ AUTHORS ๐
Anton Lindqvist <anton@basename.se>
๐ CAVEATS ๐
Recognizing fields enclosed in brackets requires ] to be present before [ in the argument given to the -d option, see re_format(7).
okay bye bestie โ this page is from Debian, dated July 10, 2015. ๐ โจ
๐ฆ where this page comes from
- arch rolling: yank 1.4.0-1 ยท MIT
- epel 10: yank 1.4.0-1.el10_3 ยท MIT
- nixpkgs unstable: yank 1.4.0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms