til/Development/Bash
sudo pacman -Syu 3dba56b0a3 improve bash and zsh 2021-02-18 11:09:43 +07:00
..
README.md improve bash and zsh 2021-02-18 11:09:43 +07:00
Snippets.md bash snippets 2020-08-07 14:31:06 +07:00

README.md

Bash

Add to ~/.bashrc:

export HISTSIZE=10000
export HISTFILESIZE=10000
export HISTCONTROL=ignoreboth:erasedups
export HISTIGNORE="cd:ls:la:ll:pwd:exit"

shopt -s histappend

Shebang:

#!/usr/bin/env bash
Shorcut Explain
CTRL-A move to begining of line
CTRL-E move to end of line
CTRL-Right move forward a word
CTRL-Left move backward a word
CTRL-W clear the word behind

macOS

In macOS, Bash read ~/.bash_profile not ~/.bashrc, so edit ~/.bash_profile:

[[ -f ~/.bashrc ]] && source ~/.bashrc

To use latest Bash, install bash with Homebrew. Then append to /etc/shells:

/usr/local/bin/bash

Set default shell

chsh -s /usr/local/bin/bash