【问题标题】:copy text from the output of a previous command (using only keyboard, not mouse)从上一个命令的输出中复制文本(仅使用键盘,而不是鼠标)
【发布时间】:2022-01-18 10:25:04
【问题描述】:

如何在 bash 中使用 only 键盘(不是鼠标)从上一个命令的输出中复制文本

$ ./my_lovely_program input.txt
eggs
sugar
flour
$ <----- any way to move "up" and yank / copy the word "sugar" ?

【问题讨论】:

    标签: bash keyboard-shortcuts


    【解决方案1】:

    一旦打印了一些东西,它就消失了,bash 不再知道它的任何内容。 bash 可以拦截您的击键,但不会将之前的输出存储在任何地方。你能做的最好的就是使用tee:

    ./my_lovely_program input.txt | tee some_file
    

    some_file 将包含程序的标准输出。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-01
      • 1970-01-01
      相关资源
      最近更新 更多