Skip to main content

Bash Tips & Tricks

Bash config Tweaks

The following is a collection of handy configuration Tweaks to the bash shell. I have found each one of these options to be useful over the last decade or so.

I would recommend you add them one by one to see what best suits your workflow.

~/.bashrc
# Navigate bash prompt using VIM style navigation
set -o vi

# Create an alias for ls (to always show listings in a list with human-readable file sizes.)
alias ls="ls -hl --color=auto"

Common Tasks

Adding a new sudo user

adduser <username>
usermod -aG sudo <username>

Grant SSH access using certificates

sudo su <username>
mkdir ~/.ssh/
vim ~/.ssh/authorized_keys # paste public key.
chmod 600 ~/.ssh/authorized_keys