diff options
author | johannst <johannst@users.noreply.github.com> | 2020-03-18 23:26:10 +0000 |
---|---|---|
committer | johannst <johannst@users.noreply.github.com> | 2020-03-18 23:26:10 +0000 |
commit | 678362c55acefe62bdacee22926db4edf65efc7e (patch) | |
tree | c50a5379343dd2cd227a8657a006cb4ddf30e4b4 /print.html | |
parent | c0fbbcb873d30f059eb0a3c8c4fae0de5ebb3e26 (diff) | |
download | notes-678362c55acefe62bdacee22926db4edf65efc7e.tar.gz notes-678362c55acefe62bdacee22926db4edf65efc7e.zip |
deploy: ed2be86b970350be0b6aa8f18b63a313f3c76983
Diffstat (limited to 'print.html')
-rw-r--r-- | print.html | 99 |
1 files changed, 98 insertions, 1 deletions
@@ -83,7 +83,7 @@ <nav id="sidebar" class="sidebar" aria-label="Table of contents"> <div id="sidebar-scrollbox" class="sidebar-scrollbox"> - <ol class="chapter"><li class="expanded "><a href="ld.so.html"><strong aria-hidden="true">1.</strong> ld.so</a></li><li class="expanded "><a href="git.html"><strong aria-hidden="true">2.</strong> git</a></li><li class="expanded "><a href="awk.html"><strong aria-hidden="true">3.</strong> awk</a></li><li class="expanded "><a href="gdb.html"><strong aria-hidden="true">4.</strong> gdb</a></li><li class="expanded "><a href="radare2.html"><strong aria-hidden="true">5.</strong> radare2</a></li><li class="expanded "><a href="emacs.html"><strong aria-hidden="true">6.</strong> emacs</a></li><li class="expanded "><a href="fish.html"><strong aria-hidden="true">7.</strong> fish</a></li><li class="expanded "><a href="strace.html"><strong aria-hidden="true">8.</strong> strace</a></li><li class="expanded "><a href="lsof.html"><strong aria-hidden="true">9.</strong> lsof</a></li><li class="expanded "><a href="pidstat.html"><strong aria-hidden="true">10.</strong> pidstat</a></li><li class="expanded "><a href="time.html"><strong aria-hidden="true">11.</strong> time</a></li><li class="expanded "><a href="pgrep.html"><strong aria-hidden="true">12.</strong> pgrep</a></li><li class="expanded "><a href="pstack.html"><strong aria-hidden="true">13.</strong> pstack</a></li><li class="expanded "><a href="pstack.html"><strong aria-hidden="true">14.</strong> pstack</a></li><li class="expanded "><a href="perf.html"><strong aria-hidden="true">15.</strong> perf</a></li><li class="expanded "><a href="oprofile.html"><strong aria-hidden="true">16.</strong> OProfile</a></li><li class="expanded "><a href="od.html"><strong aria-hidden="true">17.</strong> od</a></li><li class="expanded "><a href="xxd.html"><strong aria-hidden="true">18.</strong> xxd</a></li><li class="expanded "><a href="readelf.html"><strong aria-hidden="true">19.</strong> readelf</a></li><li class="expanded "><a href="objdump.html"><strong aria-hidden="true">20.</strong> objdump</a></li><li class="expanded "><a href="nm.html"><strong aria-hidden="true">21.</strong> nm</a></li><li class="expanded "><a href="c++filt.html"><strong aria-hidden="true">22.</strong> c++filt</a></li></ol> + <ol class="chapter"><li class="expanded "><a href="ld.so.html"><strong aria-hidden="true">1.</strong> ld.so</a></li><li class="expanded "><a href="git.html"><strong aria-hidden="true">2.</strong> git</a></li><li class="expanded "><a href="tmux.html"><strong aria-hidden="true">3.</strong> tmux</a></li><li class="expanded "><a href="awk.html"><strong aria-hidden="true">4.</strong> awk</a></li><li class="expanded "><a href="gdb.html"><strong aria-hidden="true">5.</strong> gdb</a></li><li class="expanded "><a href="radare2.html"><strong aria-hidden="true">6.</strong> radare2</a></li><li class="expanded "><a href="emacs.html"><strong aria-hidden="true">7.</strong> emacs</a></li><li class="expanded "><a href="fish.html"><strong aria-hidden="true">8.</strong> fish</a></li><li class="expanded "><a href="strace.html"><strong aria-hidden="true">9.</strong> strace</a></li><li class="expanded "><a href="lsof.html"><strong aria-hidden="true">10.</strong> lsof</a></li><li class="expanded "><a href="pidstat.html"><strong aria-hidden="true">11.</strong> pidstat</a></li><li class="expanded "><a href="time.html"><strong aria-hidden="true">12.</strong> time</a></li><li class="expanded "><a href="pgrep.html"><strong aria-hidden="true">13.</strong> pgrep</a></li><li class="expanded "><a href="pstack.html"><strong aria-hidden="true">14.</strong> pstack</a></li><li class="expanded "><a href="pstack.html"><strong aria-hidden="true">15.</strong> pstack</a></li><li class="expanded "><a href="perf.html"><strong aria-hidden="true">16.</strong> perf</a></li><li class="expanded "><a href="oprofile.html"><strong aria-hidden="true">17.</strong> OProfile</a></li><li class="expanded "><a href="od.html"><strong aria-hidden="true">18.</strong> od</a></li><li class="expanded "><a href="xxd.html"><strong aria-hidden="true">19.</strong> xxd</a></li><li class="expanded "><a href="readelf.html"><strong aria-hidden="true">20.</strong> readelf</a></li><li class="expanded "><a href="objdump.html"><strong aria-hidden="true">21.</strong> objdump</a></li><li class="expanded "><a href="nm.html"><strong aria-hidden="true">22.</strong> nm</a></li><li class="expanded "><a href="c++filt.html"><strong aria-hidden="true">23.</strong> c++filt</a></li></ol> </div> <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> </nav> @@ -361,6 +361,103 @@ As we can see the offset from relocation at index <code>0</code> points to <code difference between HEAD^ and HEAD~) git rev-list --max-parents=0 HEAD ........... first commit </code></pre> +<h1><a class="header" href="#tmux1" id="tmux1">tmux(1)</a></h1> +<p>Terminology:</p> +<ul> +<li><code>session</code> is a collection of pseudo terminals which can have multiple +<code>windows</code></li> +<li><code>window</code> uses the entire screen and can be split into rectangular <code>panes</code></li> +<li><code>pane</code> is a single pseudo terminal instance</li> +</ul> +<h1><a class="header" href="#tmux-cli" id="tmux-cli">Tmux cli</a></h1> +<pre><code class="language-markdown"># Session +tmux creates new session +tmux ls list running sessions +tmux kill-session -t <s> kill running session <s> +tmux attach -t <s> [-d] attach to session <s>, detach other clients [-d] +tmux detach -s <s> detach all clients from session <s> + +# Environment +tmux showenv -g show global tmux environment variables +tmux setenv -g <var> <val> set variable in global tmux env + +# Misc +tmux source-file <file> source config <file> +tmux lscm list available tmux commnds +tmux show -g show global tmux options +tmux display <msg> display message in tmux status line +</code></pre> +<h2><a class="header" href="#scripting" id="scripting">Scripting</a></h2> +<pre><code class="language-markdown"># Session +tmux list-sessions -F '#S' list running sessions, only IDs + +# Window +tmux list-windows -F '#I' -t <s> list window IDs for session <s> +tmux selectw -t <s>:<w> select window <w> in session <s> + +# Pane +tmux list-panes -F '#P' -t <s>:<w> list pane IDs for window <w> in session <s> +tmux selectp -t <s>:<w>.<p> select pane <p> in window <w> in session <s> + +# Run commands +tmux send -t <s>:<w>.<p> "ls" C-m send cmds/keys to pane +tmux run -t <p> <sh-cmd> run shell command <sh-cmd> in background and report output on pane -t <p> +</code></pre> +<p>For example cycle through all panes in all windows in all sessions:</p> +<pre><code class="language-bash"># bash +for s in $(tmux list-sessions -F '#S'); do + for w in $(tmux list-windows -F '#I' -t $s); do + for p in $(tmux list-panes -F '#P' -t $s:$w); do + echo $s:$w.$p + done + done +done +</code></pre> +<h1><a class="header" href="#bindings" id="bindings">Bindings</a></h1> +<pre><code class="language-markdown">prefix d detach from current session +prefix c create new window +prefix w open window list +prefix $ rename session +prefix , rename window +prefix . move current window +</code></pre> +<p>Following bindings are specific to my <a href="https://github.com/johannst/dotfiles/blob/master/tmux.conf"><code>tmux.conf</code></a>:</p> +<pre><code class="language-markdown">C-s prefix + +# Panes +prefix s horizontal split +prefix v vertical split +prefix f toggle maximize/minimize current pane + +# Movement +prefix Tab toggle between window + +prefix h move to pane left +prefix j move to pane down +prefix k move to pane up +prefix l move to pane right + +# Resize +prefix C-h resize pane left +prefix C-j resize pane down +prefix C-k resize pane up +prefix C-l resize pane right + +# Copy/Paste +prefix C-v enter copy mode +prefix C-p paste yanked text +prefix C-b open copy-buffer list + +# In Copy Mode +v enable visual mode +y yank selected text +</code></pre> +<h1><a class="header" href="#command-mode" id="command-mode">Command mode</a></h1> +<p>To enter command mode <code>prefix :</code>.</p> +<p>Some useful commands are:</p> +<pre><code class="language-markdown">setw synchronize-panes on/off enables/disables synchronized input to all panes +list-keys -t vi-copy list keymaps for vi-copy mode +</code></pre> <h1><a class="header" href="#awk1" id="awk1">awk(1)</a></h1> <pre><code class="language-markdown">awk [opt] program [input] -F <sepstr> field separator string (can be regex) |