Using text from previous commands' output

In tmux (a terminal multiplexer) you can press Ctrl+A-[ to switch to the Vi buffer mode where you can navigate around the screen, scroll the buffer back and forth, copy text etc. The default shortcut is actually Ctrl+B-[ but that was obviously meant to be reconfigured. Also, the default buffer mode is Emacs but you can configure it to be Vi.

Check out tmux, it really is a great modern terminal multiplexer. Besides working with buffer you can split screen in multiple windows, connect to the same session from multiple terminals etc. For ultimate convenience you can even make it your login shell if you tell it what your actual shell is.

On OpenBSD tmux was even made part of the base system.

See man page for tmux for more details. Also see screenshots on http://tmux.sourceforge.net/


You could use script (use -f to make sure it flushes every time) and you can have all the output in a file.

Use a terminal multiplexer (screen, tmux etc). For instance, for screen http://web.mit.edu/gnu/doc/html/screen_11.html#

Command: copy Enter copy/scrollback mode. This allows you to copy text from the current window and its history into the paste buffer. In this mode a vi-like full screen editor is active, with controls as outlined below.

Other terminal multiplexers surely have more advanced capabilities.


In emacs, M-x shell handle edition of previous output. You can easily copy paste previous commands output, or any part of your buffer, like a regular buffer. I am pretty sure there should be a vim equivalent.