Skip to main content
added 326 characters in body
Source Link
Jetchisel
  • 1.6k
  • 9
  • 12

How can I select and copy to clipboard the output, for example, of the (n-2)th line, so that I can paste it later with CTRL+SHIFT+V? (without using the mouse, everything with keyboard only)

You could use fzf and xclip something like

ls -la | fzf | xclip -selection clipboard 

Some utility/program send the output to stderr it might need an additional redirect.

my_command 2>&1 | fzf | xclip -selection clipboard 

  • On a mac replace xclip with pbcopy

  • for wayland user use wl-copy


Is it possible with arrow keys and a combination of keys?

Write a function , e.g.

my_funct(){ ls -la | fzf --height 40% --reverse | xclip -selection clipboard ; } 

bind it to a combination key e.g.

bind -x '"\C-k": my_funct' 

Call the function via: CTRL+k


As per comment suggestion one can use vim and use the stdin flag, e.g.

ls -la | vim - 

But that requires you to know how to use vim and configure/enable the clipboard feature.

How can I select and copy to clipboard the output, for example, of the (n-2)th line, so that I can paste it later with CTRL+SHIFT+V? (without using the mouse, everything with keyboard only)

You could use fzf and xclip something like

ls -la | fzf | xclip -selection clipboard 

Some utility/program send the output to stderr it might need an additional redirect.

my_command 2>&1 | fzf | xclip -selection clipboard 

  • On a mac replace xclip with pbcopy

  • for wayland user use wl-copy


As per comment suggestion one can use vim and use the stdin flag, e.g.

ls -la | vim - 

But that requires you to know how to use vim and configure/enable the clipboard feature.

How can I select and copy to clipboard the output, for example, of the (n-2)th line, so that I can paste it later with CTRL+SHIFT+V? (without using the mouse, everything with keyboard only)

You could use fzf and xclip something like

ls -la | fzf | xclip -selection clipboard 

Some utility/program send the output to stderr it might need an additional redirect.

my_command 2>&1 | fzf | xclip -selection clipboard 

  • On a mac replace xclip with pbcopy

  • for wayland user use wl-copy


Is it possible with arrow keys and a combination of keys?

Write a function , e.g.

my_funct(){ ls -la | fzf --height 40% --reverse | xclip -selection clipboard ; } 

bind it to a combination key e.g.

bind -x '"\C-k": my_funct' 

Call the function via: CTRL+k


As per comment suggestion one can use vim and use the stdin flag, e.g.

ls -la | vim - 

But that requires you to know how to use vim and configure/enable the clipboard feature.

added 170 characters in body
Source Link
Jetchisel
  • 1.6k
  • 9
  • 12

How can I select and copy to clipboard the output, for example, of the (n-2)th line, so that I can paste it later with CTRL+SHIFT+V? (without using the mouse, everything with keyboard only)

You could use fzf and xclip something like

ls -la | fzf | xclip -selection clipboard 

On a mac replaceSome utility/program send the output to xclipstderr withit might need an additional redirect.

my_command 2>&1 | fzf | xclip -selection clipboard 

  • On a mac replace xclip with pbcopy

  • for wayland user use wl-copy


As per comment suggestion one can use pbcopyvim orand use the wl-copystdin forflag, e.g.

ls -la | vim - 

But that requires you to know how to use waylandvim and configure/enable the clipboard feature.

How can I select and copy to clipboard the output, for example, of the (n-2)th line, so that I can paste it later with CTRL+SHIFT+V? (without using the mouse, everything with keyboard only)

You could use fzf and xclip something like

ls -la | fzf | xclip -selection clipboard 

On a mac replace xclip with pbcopy or wl-copy for wayland

How can I select and copy to clipboard the output, for example, of the (n-2)th line, so that I can paste it later with CTRL+SHIFT+V? (without using the mouse, everything with keyboard only)

You could use fzf and xclip something like

ls -la | fzf | xclip -selection clipboard 

Some utility/program send the output to stderr it might need an additional redirect.

my_command 2>&1 | fzf | xclip -selection clipboard 

  • On a mac replace xclip with pbcopy

  • for wayland user use wl-copy


As per comment suggestion one can use vim and use the stdin flag, e.g.

ls -la | vim - 

But that requires you to know how to use vim and configure/enable the clipboard feature.

added 196 characters in body
Source Link
Jetchisel
  • 1.6k
  • 9
  • 12

How can I select and copy to clipboard the output, for example, of the (n-2)th line, so that I can paste it later with CTRL+SHIFT+V? (without using the mouse, everything with keyboard only)

You could use fzf and xclip something like

ls -la | fzf | xclip -selection clipboard 

On a mac replace xclip with pbcopy or wl-copy for wayland

You could use fzf and xclip something like

ls -la | fzf | xclip -selection clipboard 

On a mac replace xclip with pbcopy or wl-copy for wayland

How can I select and copy to clipboard the output, for example, of the (n-2)th line, so that I can paste it later with CTRL+SHIFT+V? (without using the mouse, everything with keyboard only)

You could use fzf and xclip something like

ls -la | fzf | xclip -selection clipboard 

On a mac replace xclip with pbcopy or wl-copy for wayland

added 44 characters in body
Source Link
Jetchisel
  • 1.6k
  • 9
  • 12
Loading
Source Link
Jetchisel
  • 1.6k
  • 9
  • 12
Loading