Terminal: Difference between revisions

From Bitpost wiki
(Created page with "The linux terminal is your lifeblood. There are so many - TOO MANY - options. I'll gather a few of my favorite things here. === screen keyboard copy from buffer === HOW DID...")
 
No edit summary
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
The linux terminal is your lifeblood.  There are so many - TOO MANY - options.  I'll gather a few of my favorite things here.
The linux terminal is your lifeblood.  There are so many - TOO MANY - options.  I'll gather a few of my favorite things here.


=== screen keyboard copy from buffer ===
=== Host-specific color and banner ===
HOW DID I LIVE SO LONG WITHOUT THIS!
This is mucho importante to quickly tell which machine you are on:
* Ctrl-A-esc to get into buffer navigation mode
* use figlet and jp2a to create ascii art
* space to mark the start of the copy buffer (non-column)
* update ~/.bashrc to echo the ascii art in a host-specific color, and to persist that color in the prompt
* space to mark the end of the copy buffer
* make sure to include an interactive check to avoid the banner if not interactive
* then you can use Ctrl-A-] to paste - wait, wut? useless... what about X buffer?
See the many examples of .bashrc in the config repo.
** add this to "your screen .rc file" to send buffer to X clipboard too!
 
  bindkey -m ' ' eval 'stuff \040' 'writebuf' 'exec sh -c "/usr/bin/pbcopy < /tmp/screen-exchange"'
=== Monitor running processes ===
* top, htop are meh
* This must be perfected, it is the answer, it shows a TREE of terminal processes:
  watch -n 1 ps fT
 
=== Drop a dead ssh session ===
Remember this one to drop a dead ssh session!
  [enter]~.

Latest revision as of 14:25, 28 February 2018

The linux terminal is your lifeblood. There are so many - TOO MANY - options. I'll gather a few of my favorite things here.

Host-specific color and banner

This is mucho importante to quickly tell which machine you are on:

  • use figlet and jp2a to create ascii art
  • update ~/.bashrc to echo the ascii art in a host-specific color, and to persist that color in the prompt
  • make sure to include an interactive check to avoid the banner if not interactive

See the many examples of .bashrc in the config repo.

Monitor running processes

  • top, htop are meh
  • This must be perfected, it is the answer, it shows a TREE of terminal processes:
watch -n 1 ps fT

Drop a dead ssh session

Remember this one to drop a dead ssh session!

[enter]~.