Q. Can you tell more about UNIX user account customization along with some sample configuration?
Continue reading “Why and How To Customize a UNIX / Linux User Account?”
Q. How do I change my own profile? How do I change profile for other users? How do I setup global profile for all users under BASH shell?
A.. You need to add user profile to ~/.bash_profile. It is the personal initialization file, executed for login shells. There is also ~/.bashrc file which is the individual per-interactive-shell startup file. Common uses for ~/.bash_profile are to set environment variables such as PATH, JAVA_HOME, create aliases for shell commands and set the default permissions for newly created files etc. The file ~/.bashrc is similar, with the exception that .bash_profile runs only for Bash login shells and .bashrc runs for every new Bash shell.
Edit user .bash_profile file
Use vi command:
$ vi .bash_profile
My same profile:
if [ -f ~/.bashrc ]; then
if [ -d ~/bin ] ; then
alias dironly='printf "%s\n" */'
alias dironlyv='echo */.'
.bashrc vs .bash_profile files
Let us see the difference with these two scripts:
~/.bashrc file runs every time you open a new non-login bash shell such as xterm / aterm, and ~/.bash_profile runs only with login shells i.e when you first log in into system.
/etc/profile – System wide global profile
The /etc/profile file is systemwide initialization file, executed for login shells. You can edit file using vi (login as root):
# vi /etc/profile