Linux Aliases You Should Set Up Right Now (Guide Included)
Have you ever caught yourself typing the same long Linux command several times and thinking, “There’s got to be a better way!” That happened to me. Over time, I realized aliases are the easiest way to fix that, turning long, complicated commands into quick, one-word shortcuts.
Aliases are a built-in feature in most Linux shells, allowing users to define custom shortcuts for commonly used commands. They’re especially useful for speeding up workflows, reducing typing errors, and personalizing the terminal environment.
With just a few lines in your terminal, you can save time, avoid mistakes, and make your Linux experience way smoother. In this guide, I’ll show you how to set them up, keep them saved, and share my favorite ones that I now use every day.
If you’re new to Raspberry Pi or Linux, I’ve got something that can help you right away!
Download my free Linux commands cheat sheet – it’s a quick reference guide with all the essential commands you’ll need to get things done on your Raspberry Pi. Click here to get it for free!
Understanding Aliases on Linux
A Linux alias is like a shortcut that allows you to substitute a long or frequently used command with a short custom word or phrase of your choice. For example, instead of typing sudo apt update && sudo apt upgrade, you can define it as an alias called “update“.
This is a great way to save time and effort on typing a long command using keywords. It’s a good choice to personalize your shell and automate routine actions, and you can decide to affect your current shell session or make it persistent (keep scrolling below).
How to Create an Alias
You can create an alias on your current shell by directly typing in your terminal:alias update='sudo apt update && sudo apt upgrade -y'
And then use it, by typing:update

This alias will last only as long as the current terminal session. Once the terminal is closed, it disappears.
Tip: Command lines can be a pain to memorize. I put the essential Linux commands on a printable cheat sheet so you don't have to keep googling them. You can grab the PDF here if you want to save some time.
You can get answers from real experts in minutes.
Get help with your setup
How to Make an Alias Persistent
To save aliases permanently, you need to add them to your shell configuration file. Depending on your shell, this could be:
- ~/.config/fish/config.fish (for Fish)
- ~/.bashrc (for Bash). This is the best-known option
- ~/.zshrc (for Zsh)
Open the file in a text editor and add your alias:nano ~/.bashrc
Then add the alias and command of your choice; we can use the same one from the previous section:alias update='sudo apt update && sudo apt upgrade -y'

Finally, save the file and reload it using:source ~/.bashrc
You might also like: The 5 fastest web browsers for Raspberry Pi — tested and ranked!
You have to do this with whatever user you are using, even if you are in root. And these aliases will only be applicable per user.
Best Practices for Using Aliases
Now that you have already learned how to make them, here are a few tips to get the most out of your aliases:
- Avoid overriding critical system commands unless you’re sure.
- Use descriptive names that are short but still meaningful (update, ports, meminfo, etc.).
- Group aliases logically in your config file (e.g., system, networking, personal) using comments (#).
- Use -i flags for sensitive commands (cp, mv, rm) to avoid accidental deletions.
So, what can you do with aliases? Next, I’ll give you a list of practical examples I use regularly, organized by category. You’ll probably find a few that’ll save you time too.
Linux Aliases for System Updates
Keeping your system up to date is something you’ll often do, so why not simplify it with a few handy aliases?

Update and Upgrade in One Go
This alias combines apt update and apt upgrade in one simple command:alias update='sudo apt update && sudo apt upgrade -y'
I run this every week to ensure all my packages are always on the latest version.
Related: How to Set Up Automatic Updates on Linux (Keep Your System Safe)
Bonus tip: If the terminal still feels confusing, I made a simple cheat sheet with 74 commands explained in plain English. You can grab it here for free..
Clean Unnecessary Packages
Automatically removes unused packages and cleans up cached files:alias cleanup='sudo apt autoremove -y && sudo apt autoclean'
This is ideal if you have a low disk capacity or are planning to install a major package.
Related: How to Manage Disk Space on Linux Like a Pro
File & Directory Management With Linux Aliases
Managing files and folders is an everyday task in the terminal. With a few aliases, however, you can significantly speed up your productivity and daily life.
These aliases will help you navigate more quickly, prevent accidental file errors and ensure that your command line experience is straightforward and efficient.

Colored LS Output With Common Options
Let’s start with a basic improvement. Listing files becomes much easier to read when colors are added to distinguish between file types, permissions and directories.alias lsp='ls -lah --color=auto'
I use this alias to replace the usual ls, as it not only adds color but also includes file size, permissions, and hidden files, all in one go. It’s a compact and easy command to remember.
Jump Back a Level Easily
Navigating up the directory structure can become tedious if you do it often. This alias lets you jump up one level with zero difficulty:alias ..='cd ..'
Bonus: You can even go deeper and also do …=’cd ../../’ for going two levels up. Trust me you’ll appreciate the time saved.
Create Directories with Parents
Ever tried to make a directory and received a “No such file or directory” error? That’s because the parent folder doesn’t exist. This alias fixes that by creating all necessary parent directories:alias createdir='mkdir -pv'
It’s useful when scripting or when you’re working on a project that requires multiple nested folders.
Quickly Navigate to Favorite Folders
If you always go to the same directories, like your root, Downloads, or a specific project folder and set custom aliases for them: alias goroot='cd /'alias rpitips='cd ~/rpitips'
I’ve set one up for every major project I work on; it’s like having bookmarks on your terminal.
Safe Copy and Move
We’ve all deleted the wrong file by mistake. These aliases prompt you before overwriting or deleting anything critical:alias copy='cp -i'alias move='mv -i'alias remove='rm -I --preserve-root'
With these in place, you’ll get a chance to confirm before anything irreversible happens. A real lifesaver when working fast.
Linux Aliases for Networking & Debugging
When something’s wrong with your connection or a remote server isn’t responding, these aliases come in handy. They’re great for quick checks and routine network debugging.

Short and Readable Ping
Typing ping repeatedly can get annoying, especially when you want cleaner output. This alias gives a prettier view:alias pping='prettyping --nolegend'
You’ll need to install prettyping for this to work, but once you do, it replaces the default ping with a more readable format that’s easier on the eyes.
If you’re new to Linux or looking for more helpful commands like this one, check out this comprehensive guide to Linux troubleshooting for additional tools and tips for your daily use.
Check Your Public IP
Need to find out what your external IP address is? Just use:alias myip='curl ifconfig.me'
I use this all the time when connecting to remote servers or configuring firewalls. No more Googling “what’s my IP”.
View IP Addresses and Interfaces
You probably already use ip a, but if you’re coming from a Windows background, this alias will feel familiar:alias ipconfig='ip a'
You might also like: Probably one of the best Raspberry Pi workstations (review)
That command is probably familiar to you, and indeed, it is because it is one of the most commonly used in Windows. So, maybe this is longer than the original command, but with a familiar command like this, it is almost impossible to forget it.
List Open Ports
Want to see which services are listening for incoming connections? Try:alias ports='sudo netstat -tulpena'
Alternatively, you can use ss -tuln if netstat isn’t installed. This command helps spot unauthorized services or check if something like SSH is actively listening. There are other commands you can use to check your open ports. You can find out more in our dedicated article about it.
Check a Remote Server’s Response
Sometimes, you want to know if a site is up or what code returns. This simple alias helps:alias checksite='curl -I'
You can quickly see server response codes, cache status, and other HTTP headers, perfect for web developers or sysadmins.
System Info Using Linux Aliases
Whether you’re debugging or just curious, these aliases give you instant insights into your machine’s hardware and resource usage.

Bonus tip: If the terminal still feels confusing, I made a simple cheat sheet with 74 commands explained in plain English. You can grab it here for free..
Memory Usage
A clean, readable memory summary:alias meminfo='free -m'
I run this one anytime I want to see what’s eating up my RAM. It’s handy on servers with limited memory or with hungry resource processes.
CPU Info
Want to check what processor you’re running? Try:alias cpu='lscpu | grep "Model name"'
This filters out just the CPU model line, so you don’t have to scroll through unnecessary info. Great when comparing systems or setting up performance monitors.
Disk Usage
How much disk space do you have left? This will tell you, per partition:alias disk='df -h'
The -h flag ensures the output is human-readable. I use this before large file transfers or updates to avoid filling up the drive. For more ways to free up disk space on Ubuntu or other Linux systems, check out our detailed guide.
List Partitions
To quickly see where all your partitions are mounted and in what format:alias mounts='mount | column -t'
This formats the output nicely, making it easier to read at a glance. It’s also useful for troubleshooting mount issues.
Still stuck after following this guide? Drop your question in the RaspberryTips Community — real Pi users answer fast. Post your question here.
Fun and Personal Linux Aliases
These aren’t essential, but they add a bit of personality and fun to your terminal. Not everything has to be about efficiency; sometimes it’s just about making your terminal more fun or maybe more you.

View Your Command History
This is a very well-known command, and this alias helps you to make it even shorter. You can use this constantly to recall old commands:alias h='history'
You can even scroll through it or filter it with another alias. If you want to learn more tips and tricks for using command history efficiently, then check out our guide to the history command.
Search Previous Commands
Forget that one weird and long command that you ran last week? Find it with:alias hs='history | grep'
Just type hs + command or any keyword to narrow down your search.
Check the Time or Date
These are simple but useful when working across different time zones or during scheduling tasks:alias now='date +"%T"'alias today='date +"%A, %B %d"'
I even use it to timestamp logs or name backups inside any script.
Speed Test Your Internet
Ever felt like your internet is lagging? Use this alias to check your bandwidth:alias speed='speedtest-cli'
It’s accurate and useful, especially if you’re managing network-related tasks. Make sure speedtest-cli is installed first. For a full walkthrough on how to monitor your internet speed using this tool, check out this detailed guide.
Get Current Weather
Yes, you can check the weather from your terminal, and it looks cool too!alias weather='curl wttr.in'
I sometimes run this just for fun, or before heading out for the day.
As you’ve seen, Linux aliases are more than just a trick; they’re a real productivity booster that can help you with your day-to-day tasks and save you from repetitive typing. Although it only takes a few minutes to set them up, they’ll save you time in the long term.
Not getting the same result?
Even when you follow every step, small differences in OS version, hardware or config can change the outcome. Instead of wasting time guessing, get help from people who have already fixed the same kind of issue.
- Get help on your exact issue
- Access step-by-step videos for tricky setups
- Browse the website without ads
