Close Menu
Linux All DayLinux All Day
    Facebook Bluesky Mastodon X (Twitter)
    Linux All DayLinux All Day
    • News
    • Operating Systems
      • Linux Distributions
      • Android-based OS
      • ChromeOS Alternatives
    • Software
      • Apps & Tools
      • Desktop Environments
      • Installation & Management
    • Tutorials
      • Linux Basic & Tips
      • System Optimization
      • Security & Privacy
    • Linux Gaming
      • Game News & Reviews
      • Emulators & Retro
      • Performance & Benchmarks
    • Comparisons
    Mastodon Bluesky Facebook
    Linux All DayLinux All Day
    Home - Tutorials - Linux Basic & Tips - Speed Up Your Workflow: A Guide to Linux Aliases

    Speed Up Your Workflow: A Guide to Linux Aliases

    By Mitja Linux Basic & Tips May 25, 20263 Mins Read
    Share Facebook Bluesky Twitter Threads Reddit LinkedIn Telegram Tumblr Email Copy Link Pinterest
    Follow Us
    Facebook Mastodon Bluesky X (Twitter)
    Infographic showing Linux aliases examples on a computer monitor to boost terminal productivity.
    Optimize your workflow by creating custom shortcuts for frequent commands.
    Share
    Facebook Twitter Bluesky Reddit Threads Tumblr Email Copy Link

    If you spend a lot of time in the Linux terminal every day, you certainly encounter repetitive and lengthy commands. Why type complex syntax over and over again when you can make your life easier? This is where Linux aliases come into play.

    What is a Linux Alias?

    An alias is a user-defined shortcut for an existing shell command. It acts as a pseudonym: when you type a short word or letter into the terminal, the shell replaces it with a predefined full command or a sequence of commands.

    With aliases, you can:

    • Shorten long and complex commands.

    • Add default flags (arguments) to standard commands.

    • Prevent typos during complex operations.

    How to Create a Temporary Alias

    A temporary alias is only valid for your current terminal session. Once you close the terminal or disconnect your SSH session, the alias is deleted. This is ideal for quick testing.

    The syntax is straightforward:

    Bash

    alias shortcut_name='full_command'
    

    Important: There must be no spaces around the equals (=) sign. Using single quotes (') is best practice to prevent the shell from expanding variables prematurely.

    Example:

    If you want the command c to clear the screen instead of typing clear:

    Bash

    alias c='clear'
    

    How to Create a Permanent Alias (Step-by-Step Guide)

    If you want your aliases to persist after a system reboot, you must save them in your shell’s configuration file.

    Step 1: Find Out Which Shell You Are Using

    Most commonly, this is either bash or zsh. You can check it with the following command:

    Bash

    echo $SHELL
    

    Step 2: Open the Configuration File

    Depending on your shell output, open the corresponding file in your home directory (~) using your preferred text editor:

    • For Bash: nano ~/.bashrc

    • For Zsh: nano ~/.zshrc

    Step 3: Add Your Aliases

    Scroll to the bottom of the file and add your custom shortcuts. Example configuration:

    Bash

    # My custom aliases for productivity
    alias ll='ls -la --color=auto'
    alias update='sudo dnf update -y'  # Change to apt or pacman based on your distro
    alias ports='sudo netstat -tulanp'
    

    Step 4: Save and Refresh the Settings

    Save the file (Ctrl+O then Ctrl+X in nano). To apply the changes immediately without restarting your terminal, refresh the session using the source command:

    Bash

    source ~/.bashrc
    # or source ~/.zshrc if you use zsh
    

    Practical Examples for Better Productivity

    Here are some battle-tested aliases that will save you time in both daily tasks and production environments:

    AliasActual CommandDescription
    alias ..='cd ..'cd ..Move back one directory level
    alias ...='cd ../..'cd ../..Move back two directory levels
    alias dps="docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'"Docker OutputClean and readable layout of running containers
    alias myip='curl ifconfig.me'curl ifconfig.meQuickly check your public IP address
    alias path='echo -e ${PATH//:/\\n}'Print PATHDisplays system paths line-by-line for readability

    How to Remove an Alias

    To temporarily disable an alias in your current session, use the unalias command:

    Bash

    unalias shortcut_name
    

    To permanently remove an alias, simply open your configuration file (.bashrc or .zshrc), delete the line containing the alias, save the file, and run the source command again.

    Conclusion

    Aliases are a simple yet incredibly powerful tool to customize your workflow. By optimizing the commands you use most frequently, your time in the Linux terminal will become faster, more efficient, and less prone to typing mistakes.

    Follow on Mastodon Follow on Bluesky
    Share. Facebook Twitter Bluesky Reddit Threads Telegram Email Copy Link

    Related post

    Did You Know? 5 Technical Linux Facts Most Professionals Miss

    December 7, 2025

    How to Install Visual Studio Code on Chrome OS Flex: The Official Engineering Method

    December 3, 2025

    How to Enable Linux Apps on Chrome OS Flex

    December 3, 2025
    → Switch to Linux Today
    • Facebook
    • Twitter
    • Mastodon
    • Bluesky
    More From Linuxallday
    Beyond the Grid: Mastering the Zen Flow of Bryce Tiles
    Mozilla Confirms Full “AI Kill Switch” for Firefox, Arriving in Early 2026
    Rescuezilla Review 2025: The ‘Undo Button’ for Your Entire PC
    Tails OS Review 2025: The Ultimate Amnesic System for Total Privacy
    Facebook X (Twitter) Mastodon Bluesky Threads RSS
    • About Us
    • Cookie Policy
    • Terms & Conditions
    • Privacy Policy
    • Disclosure & Disclaimer
    • Contact
    • Our Authors
    • Cookie Policy (EU)
    © 2026 Designed by FeedCrux

    Type above and press Enter to search. Press Esc to cancel.

    Manage Consent
    To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
    Functional Always active
    The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
    Preferences
    The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
    Statistics
    The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
    Marketing
    The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
    • Manage options
    • Manage services
    • Manage {vendor_count} vendors
    • Read more about these purposes
    View preferences
    • {title}
    • {title}
    • {title}