Struggling to Set Up Aliases on Ubuntu: What Am I Missing?

0
3
Asked By CuriousCat99 On

Hey folks! I'm new to Ubuntu and I'm trying to transition my Plex server to an old desktop while getting the hang of using the terminal. I've been following a tutorial from learnlinux.tv that walks you through command line basics. I followed the steps to create an alias by editing the .bashrc file in Nano, but it just didn't work for me.

I initially tried setting the alias with 'alias c=clear', but that didn't respond, so I tried variations like 'alias c='clear'', still no luck. There were some references to a .bash_aliases file, but it doesn't exist in my home directory, and when I created one with 'touch' and added the alias, it still didn't work. I'm feeling stuck here! I know this is a beginner question, but I really want to understand how aliases work before diving deeper into terminal commands. If anyone can help clarify what I'm missing, I'd appreciate it! Also, if you have any resources to recommend for learning, that would be awesome!

1 Answer

Answered By TechieTom85 On

Make sure to put quotes around your command like this: 'alias c='clear''. Also, avoid spaces around the equals sign. The .bash_aliases file is an option if you want to use it, but your aliases should definitely work in .bashrc too. Have you tried entering the alias directly in the terminal? If it doesn't work, let us know if any error messages come up!

CuriousCat99 -

Thanks for the tip! I actually realized I had to source the .bashrc file first! Still not sure what sourcing does, but it worked!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.