Files
tldr/pages.zh/common/yank.md

20 lines
438 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# yank
> 从 `stdin` 读取输入并显示选择界面,允许选择字段并复制到剪贴板。
> 更多信息:<https://manned.org/yank>。
- 使用默认分隔符(\f, \n, \r, \s, \t进行 yank
`{{sudo dmesg}} | yank`
- yank 整行:
`{{sudo dmesg}} | yank -l`
- 使用特定分隔符进行 yank
`{{echo hello=world}} | yank -d {{=}}`
- 仅 yank 匹配特定模式的字段:
`{{ps ux}} | yank -g "{{[0-9]+}}"`