RHEL 7 RHCE EXAM OBJECTIVE SOLUTION - SYSTEM WIDE ALIAS COMMANDS

Creating system-wide aliases.

If you want aliases to be available to every user of a server, you will need to place the aliases into /etc/profile.d/your-custom-name.sh. This is the preferred place to create them so there are not conflicts or overwrites for any future upgrades. To have these available for just one user, you can create a custom bashrc file in your home directory. EX: /home/user1/.bashrc. But remember, that will only be available for the one user. It may be preferred to standardize under profile.d.

[root@rhel7-exam-objectives ~]# vi /etc/profile.d/useralias.sh
alias listit='ls -al | column -t'