Command Line

Aliases

Some useful bash aliases.

Quick access aliases

Ping but limit to five attempts.

alias p='ping -c 5'

Reset terminal.

alias r='reset'

Retrieve temperature of CPU and other hardware.

alias t='sensors'

Output system uptime and load statistics.

alias u='uptime'

Other aliases

Display dmesg output within a pager.

alias dmesg='dmesg -H'

Show line numbers when grepping.

alias grep='grep -n'

Display only hidden files in a directory.

alias hidden='ls -lisAd .[^.]*'

Make a directory and immediately change into it.

alias mkcd='mkdir $1 && cd $1;'

Remove help section of nano.

alias nano='nano --nohelp'

Display verbose output and progress of rsync.

alias rsync='rsync -v --progress'

Update and upgrade using apt in a single command.

alias update='sudo apt update; sudo apt dist-upgrade -y'

Continue wget downloads by default.

alias wget='wget -c'

Reload aliases from bash (without having to close the terminal).

alias rebash='source ~/.bashrc'

Functions

Upgrade packages (apt)

Initiate upgrade of any packages.

function update() { sudo apt dist-upgrade -y $@; }

Install packages (apt)

Install one or more defined packages.

function install() { sudo apt install $@; }

Remove packages (apt)

Remove one or more defined packages.

function remove() { sudo apt autoremove --purge $@; }