Here are mine:<p>1. create aliases for everything in ~/.bashrc to speed things up<p>2. window stacking / multi-tasking in iTerm with cmd + (shift) + d<p>3. turn on vi(m) syntax highlighting by adding :syntax on to ~/.vimrc<p>4. use jq to format and colorize json files / streams with the pipe | operator (so useful!)<p>5. Generate a custom command prompt at http://bashrcgenerator.com/ (just for fun)<p>I really like this topic, so made a video going into more detail on mine, if anyone's interested
https://youtu.be/okGN2RXFw_U
Using the caret (^) character to correct mistakes.<p>Imagine you write something like this:<p># moutn -o ro -o remount /dev/hda0 /<p>Arg! I should have written mount, not moutn!<p>Easy fix:<p># ^moutn^mount<p>I find it better than editing the last line (with cursor). It even works at boot and without 'doskey-like' arrow history.
byobu and tmux are god-tier<p>vim: use :!some_shell_command --with_arguments to run a shell command from within vim quickly<p>also :set hlsearch to allow search highlighting, and use :noh to disable the current highlight once you no longer need the text to be a different color<p>tmux: Prefix-[ to scroll up console text. use / to search down, and ? to search up (just like in vim)<p>tmux: Prefix-z to zoom current pane to full size of window<p>zsh: vi-mode plugin to quickly use vim shortcuts on terminal input text, history-substring-search plugin to quickly remember what finicky command I was using earlier<p>also shells in general: ctrl-s to pause text (eg if you want to pause log spam), ctrl-q to resume<p>ssh -XC for compressed x11 forwarding, to speed up x11 responsiveness<p>on remote server: python2 -m SimpleHTTPServer 8080 --bind localhost to quickly start a simple file/http server from the current directory that is NOT internet accessible (ie nobody steals your shit)<p>then on local computer: ssh -L 8080:localhost:8080 to tunnel to remote server's localhost server. then just type in localhost:8080 in firefox to access remote server's files
Pretty sure these count:<p>ctrl+r (reverse search) on steroids: fzf (<a href="https://github.com/junegunn/fzf" rel="nofollow">https://github.com/junegunn/fzf</a>)<p>put a symlink to my dot files to a dropbox folder (always backed up .bash_profile or whatnot)<p>ssh tunnel to expose a port from a remote server on my computer: ssh -L 8500:localhost:8500 $remotehost<p>expose a port on my machine to the internet (demos and such): <a href="https://ngrok.com/" rel="nofollow">https://ngrok.com/</a><p>git bash prompt and git completion: know at a glance the branch I'm on and if there is un-staged/un-committed code. Allow tab complete for remotes and branch names. Lots of options here.<p>autojump (<a href="https://github.com/wting/autojump" rel="nofollow">https://github.com/wting/autojump</a>): `j foo` will jump directories to my /whatever/foo directory. Better than popd and pushd.<p>And before I had it baked into my prompt: `echo $?` to show the exit code of my last command.
ctrl+r for reverse searching of previous command<p>add a "# tags" at any commands end to use above for future.<p>so lets say you have a ssh into multiple servers<p>$ ssh -Uasfd host1 # server1<p>$ ssh -Uaiouhqe host2 # server2<p>then later, ctrl+r -> and type ver1
<p><pre><code> $ mv file.text !#:1:r.txt
evaluates to:
$ mv file.text file.txt
(colon separated)
!# means this command
1 is the position of the argument to be modified
r means strip extension
</code></pre>
There's tons of history modifiers and a lot to be learned reading `man bash`.
1. for vim - <a href="https://laymanclass.com/vim-essential-setup-to-boost-your-productivity/" rel="nofollow">https://laymanclass.com/vim-essential-setup-to-boost-your-pr...</a><p>2. autojump<p>3. solarized theme<p>4. zsh and antigen(particularly <a href="https://github.com/desyncr/auto-ls" rel="nofollow">https://github.com/desyncr/auto-ls</a> and
<a href="https://github.com/psprint/zsh-navigation-tools" rel="nofollow">https://github.com/psprint/zsh-navigation-tools</a>)
Do you mean cmd shift t? The d exits the terminal, which is the opposite of what I assume you meant. T for Terminal, and D for Die.<p>Also in .vimrc I add: set noswapfile, set nobackup, and
set nowb<p>These were probably useful when terminal sessions were conducted over flaky modem connections. I use Raspberry Pis a lot, so I'd rather not speed up the SSD card's inevitable failure.
fd is a simple, fast and user-friendly alternative to find. Install from <a href="https://github.com/sharkdp/fd/" rel="nofollow">https://github.com/sharkdp/fd/</a>. Example: to find all files with .md extension in current directory : fd -e md
Ctrl-z to suspend a program, jobs to view the list of suspended programs and fg to resume a program.<p>They are the terminal equivalent of iconising a window. You can do some form of multitasking without screen/tmux/byobu
ctrl-r to history search commands<p>ctrl-a to go to begining of line, ctrl-e to go to end of line, ctrl-u to delete line<p>oh-my-zsh to display nice contextual info on git, navigate more easily etc.<p>If you have commands you use regularly (unit test, building, git, etc.), keep a tab for each and create a profile so that it goes directly in the folder you need, and can have a different color.
use less for safe read-only mode and to utilize vim commands still<p>esc-b to jump back a word on the terminal<p>esc-f to jump forward a word on the terminal<p>nerdcommenter (my favorite vim plugin)<p>git-gutter (my 2nd favorite vim plugin)<p>!-2 (repeats 2nd to last command)<p>practice! <a href="https://www.shortcutfoo.com/app/dojos/vim" rel="nofollow">https://www.shortcutfoo.com/app/dojos/vim</a>
history<p>I didn't know that command even exists. You can just use it in pipe with grep/sed/... to look for specific commands used in servers you do not directly manage often (Eg last time I used them I was looking for all the docker commands in a server to understand how to startup the correct containers and in which order)
fc ("fix command") opens an editor with your last command and executes it when you leave the editor. fc -l lists your latest commands, fc -ln does so without line numbers. Useful if you want to write a script (fc -ln > myscript.sh).
pushd/popd - manipulate a stack of directory paths.<p>Useful to save the current directory, go somewhere else, do stuff and then come back to the original directory.<p>It works awesomely in bash scripts too!