Show Menu
Cheatography

Personal Bash/Tmux Cheat Sheet by

Notes

Command derived from plugin
Command derived from prefer­ences
.tmux.conf for this cheatsheet available on Github brennanmeadowcroft/dotfiles

.bash­_pr­ofile for this cheatsheet available on Github brennanmeadowcroft/dotfiles

TMUX

<Tmux Leader­>+x
Close current pane
<Tmux Leader­>+-
New horizontal pane
<Tmux Leader­>+|
New vertical pane
<Tmux Leader>+z
Toggle current pane to full screen
<Tmux Leader­>+[
Set cursor to move up screen
Alt+<­arr­ow>
Move to pane in direction of arrow / / /
<Tmux Leader­> is Ctrl+a
 

Navigating Direct­ories

ls
List contents of current directory
tree
Display current directory and one level below as tree
tree <dir>
Display <d­ir> and one level below as tree
cd <di­r>
Change directory to <d­ir>
cd ..
Move up to parent of current directory
cd -
Change to previous working directory
pushd <dir>
Create mark for <d­ir> in a stack
popd
Go to marked directory at top of stack

Working With Lines

Ctrl+a
Move cursor to BEGIN­NING of current line
Ctrl+e
Move cursor to END of current line
Alt+b
Move cursor BACK one word
Alt+f
Move cursor FORWARD one word
Ctrl+k
Delete from cursor to END of line
Ctrl+u
Delete from cursor to BEGIN­NING of line
Alt+d
Delete word IN FRONT of cursor
Ctrl+w
Delete word BEHIND cursor
 

Navigating Processes

ps
List running processes in Bash
ctrl-z
Move current process to background in suspe­nded state
bg
Start most recent suspended process & run in background
fg
Bring most recent background process to foreground
kill <pid>
Force quit <p­id> from ps
The output of ps can be piped to another command such as grep or kill

Working With Files

vim <fi­le>
Open a file in vim
vim .
Open vim at current working directory
open .
Open current directory in Finder (OSX)
cat <fi­le>
Read and output current file into bash
less <fi­le>
Display a paged version of file in terminal
findfile <file>
Search current directory and children for <f­ile­>
Using less instead of cat keeps bash history and screen clean as less opens another window for viewing

Help Us Go Positive!

We offset our carbon usage with Ecologi. Click the link below to help us!

We offset our carbon footprint via Ecologi
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Linux Command Line Cheat Sheet
          Bash/ZSH Shourtcuts Cheat Sheet
          bash Shortcuts Cheat Sheet

          More Cheat Sheets by brennanmeadowcroft