RT Cunningham

Previous

Useful Shell Aliases

Written on Jul 9, 2026

Tagged: linux

terminal emulator

The terminal emulator built into various GNU/Linux distributions, with the aid of certain utilities, can do more than most people can imagine. I touched on this in a previous article. In Linux Mint, the user shell is called "BASH" (Bourne Again Shell).

When a user session begins, certain BASH configuration files are read, including the ".bashrc" file. This file is where shell aliases can be added or changed. Simply logging out and logging back in will make them available from the command line.

Updating and Cleaning Up

This is an alias I use from the command line to ensure my system is completely up-to-date and anything that needs to be removed is actually removed. The command is "update":

alias update='sudo apt update && sudo apt full-upgrade && sudo apt autoremove -y && sudo apt autoclean && flatpak update -y && flatpak uninstall --unused -y'

Since I'm not constantly installing or removing software, the command rarely does anything and I rarely need to use it.

Clearing the Zram Swap Partition

I have 16 gigabytes of memory, and Linux Mint runs in less than half of that very comfortably. Instead of the default two-gigabyte swap file, I use a four-gigabyte zram partition, which is something I do for both performance reasons and hardware longevity.

I have an applet in the panel that shows me how much swap space is being used at all times. It usually reads "0B". The only times I've seen it increase is when copying large files from drive to drive and when testing virtual machines.

There are two ways to return it to zero. The first is to reboot, which I avoid as much as possible. The second is to issue a series of commands to clear it immediately. The command is "clear":

alias clear='sudo swapoff /dev/zram0 && sudo mkswap /dev/zram0 && sudo swapon /dev/zram0'

Since I'm not copying files every day and I'm not testing virtual machines every day, I don't run the command often. Sometimes, I don't even bother to run it as long as the swap usage shows less than two gigabytes. I have yet to reach four gigabytes for any reason.

Image by OpenClipart-Vectors from Pixabay

Previous