Skip to content

Using Aliases & Shortcuts – Making Life Easier

Ah, young warrior, welcome back! 🥷

A true Linux ninja never types long commands twice. Instead, they use the sacred art of aliases & shortcuts to move at the speed of light! ⚡

Why waste time typing ls -la when you can simply summon it with ll? Why remember complex commands when you can create your own shortcuts?

Let’s begin your training! 🎯

The Power of Aliases – Become the Speed Demon

Aliases are shortcuts for commands. Instead of typing long, boring commands, we can create our own ninja moves!

🎭 Creating an Alias

Use the alias command like this:

bash
alias short_command="long and painful command"

Examples:

CommandWhat It Does
alias ll="ls -la"🔍 Shortens ls -la to ll
alias ninja="echo I am invisible!"🎭 Fun alias
alias home="cd ~"🏡 Moves to home directory
alias ..="cd .."🚶 Moves up one folder

💡 Try it now:

bash
alias hi="echo Welcome, warrior!"
hi  # Runs the command

Making Aliases Permanent – The Secret Scrolls

By default, aliases disappear when you close the terminal. To keep them forever, store them in a hidden scroll:

For Bash users:

bash
nano ~/.bashrc  # Open the config file

For Zsh users:

bash
nano ~/.zshrc

Then add your aliases at the bottom:

bash
alias ll="ls -la"
alias ninja="echo I am invisible!"

Save and apply changes:

bash
source ~/.bashrc  # Or ~/.zshrc

Now, your aliases live forever! 🎉

The Art of Fast Navigation – Shortcut Paths

A true warrior never wastes time typing long paths.

ShortcutWhat It Does
cd ~🏡 Moves to home directory
cd ..🔙 Moves one level up
cd -🔄 Switches to previous directory
cd /etc⚡ Jumps to a specific folder

Custom Shortcuts – The Ultimate Hack

Tired of typing long, painful commands? Create a function instead!

bash
# Make a function in your ~/.bashrc or ~/.zshrc
mybackup() {
  tar -czvf backup.tar.gz $1
}

Now, instead of typing:

bash
tar -czvf backup.tar.gz my_folder

Just run:

bash
mybackup my_folder

Boom! Instant productivity boost! 🚀

Built by noobs, for noobs, with love 💻❤️