Adding Bash Aliases In Ubuntu, Including System-Wide

I have some alias commands that I’m quite used to having around, the most prominent being “ll”, which I alias to “ls -l”.  Ubuntu and it’s various flavors, however, don’t send that preloaded.  The fix is really quite simple for a single user.  Simply edit your ~/.bashrc file and add the aliases you want to the end of that file like this, with one alias per line:

alias ll='ls -l'

That’s great, but all of the peole that share my machines also like having an ll command.  It seems senseless that we would all have to do that, right?  Enter the system wide bashrc file, located at /etc/bash.bashrc.  Simply add your aliases at the bottom of that file and they’ll be applied to all users.  Just be forewarned that the Ubuntu update procedures can overwrite this file, so keep your aliases backed up somewhere for possible restoration later.

Another option for people who haven’t already created their users is to update the /etc/skel/.bashrc file.  This is the file that will be copied to any new user’s home directory when they are created.

  • Share/Bookmark