Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are default aliases defined in Amazon Linux?

Tags:

linux

bash

Playing with VM's (Amazon Linux) and I figured I wanted to add an alias la = "ls -al"

Sure, all good. But in the process, I noticed there were no aliases defined in my home directory (e.g. .bashrc, et. al.) nor in /etc/bashrc.

And yet, when I run alias, I get a bunch of pre-existing aliases...

Where do they come from?

like image 742
Paul van den Bergen Avatar asked Oct 16 '25 16:10

Paul van den Bergen


2 Answers

grep alias /etc/*/*

says /etc/profile.d contains shell scripts with alias definitions.

like image 183
Paul van den Bergen Avatar answered Oct 19 '25 05:10

Paul van den Bergen


Run PS4=':${BASH_SOURCE}:${LINENO}+' bash -x -l -i to log to stderr every command invoked during your shell's startup with the file name and line number where it came from. Searching this log should make the relevant location clear.

like image 42
Charles Duffy Avatar answered Oct 19 '25 07:10

Charles Duffy