- Ignore history duplicates
- History size
- Delete word
- History search with arrows
- Faster cd upwards
- Make mc exit to current directory
- Bash argument auto completion
Using the shell in Linux makes a lot of operations more convenient and faster.
In order to make things even more comfortable here are a few tips to setup the
bash shell. Put these lines in your
Ignore history duplicates
This will ignore duplicate history elements in the
This will set the size of the
~/.bash_history file. The number indicates
the number of lines (by default usually 500). This option combined with the
option above will provide quite a big history of unique commands (which means
less typing in future ;).
Ctrl-W it will delete a word backward (just like in Vim)
History search with arrows
Most will be familiar with the
Ctrl-R command history search feature. This
is something similar but more practical. One has to type in the few first
characters and then use the ↑/↓ (up/down) arrow keys to step
through the command history that match that beginning.
bind '"\e[A"':history-search-backward bind '"\e[B"':history-search-forward
Faster cd upwards
These aliases will bind the upwards cd (change directory) commands to an arbitrary number of dots. This will speed up the most common cases. One could have more levels of course but after some degree it becomes impractical.
alias ..="cd .." alias ...="cd ../../" alias ....="cd ../../../" alias .....="cd ../../../../"
Make mc exit to current directory
This will make
mc exit to the directory of the active panel instead of the
mc was started from.
Bash argument auto completion
In order for the shell to auto complete command line arguments in Gentoo you
have to put this into your
~/.bashrc file. Don’t forget to add some commands
you want for bash auto completion using the