Documentation about how to be productive with a terminal.
Ctrl + r : Reverse search. (ctrl+r to go back through the history).Ctrl + l : Clear the screen (instead of using the “clear” command).Ctrl + p : Repeat the last command.Ctrl + x + Ctrl + e : Edit the current command in an external editor (need to define export EDITOR=vim).Ctrl + shift + v : Copy / paste in Linux.Ctrl + a : Move to the beginning of the line.Ctrl + e : Move to the end of the line.Ctrl + xx : Move to the opposite end of the line.Ctrl + left : Move left one word.Ctrl + right : Move right one word.
man <cmd> : Open man page of command.
space : go ahead page by page.b : go back page by page.q : quit.Enter : go line by line./<word> : search a word in man.n : go to the next expression that you search.N : go back to search expression.man -k <key word> : look for in all man for your key words.man -k <word1>.*<word2> : “.*” allow to search several words.whatis <cmd> : give short explaination about the command.
Useful to keep a trace, or to document and share what has been done.
script : save all commands and results in a “typescript” file.script -a : append to an existing “typescript” file (otherwise erase the previous one).exit : to stop the session.
asciinema : save the terminal session as a video.
For RHEL - something like Tlog exists and can be configured and centralised with Rsyslog.
git clone https://github.com/tmux-plugins/tmux-logging.git
tmux new -s my_session : Create a new session.tmux attach : Attach to the last used session.tmux attach -t X : Attach to the tmux session with number X.tmux ls : List active tmux sessions.tmux split-window -dh "!!" : Run a command in a separate pane.tmux source-file ~/.tmux.conf : Reload config.
C-b w : List sessions/panes.C-b x : Close pane or session.
echo $’\xae’ = “ยฎ”
Vim has a special shorthand for entering characters with diacritical marks. If you need some familiar variant of a Latin alphabet character youโll be able to input it with the digraph system.
Digraph input is started in insert or command mode (but not normal mode) by pressing Ctrl-k, then two printable characters in succession.
The first is often the โbaseโ form of the letter, and the second denotes the appropriate embellishment.
https://vimvalley.com/ https://vim-adventures.com/ https://www.vimgolf.com/
1# HCL
2mkdir -p ~/.vim/pack/jvirtanen/start
3cd ~/.vim/pack/jvirtanen/start
4git clone https://github.com/jvirtanen/vim-hcl.git
5
6# Justfile
7mkdir -p ~/.vim/pack/vendor/start
8cd ~/.vim/pack/vendor/start
9git clone https://github.com/NoahTheDuke/vim-just.git
trigger a vim tutorial vimtutor
the most powerful commands:. : Repeat the last modification.* : Where the cursor is located, keeps the word in memory and goes to the next occurrence..* : together, repeat an action on the next word.