proper file to set up aliases for 1. individual users 2. specific groups 3. all users

been googling to try to find this, and now more confused than I was when I started.

I've got several boxes that multiple users use, a mix of RHEL4 and a few gentoo.  xdm is running on all but one gentoo box, so that's how most users connect.  Several open up bash konsoles, and a few open up ksh shells

What are the generally recognized files used set up aliases that a user will have when s/he logs in, and that won't get overwritten on some update?

What is the generally recognized file used for global aliases, that won't get overwritten on some update?

What are the generally recognized files used for setting up configuration and environment and add aliases and such for specific groups (e.g. accounting, warehouse, admin, powerplant)

Thanks
amlpAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ircpamanagerConnect With a Mentor Commented:
If i understand you correctly,  each user has a file called .bash_profile and .bashrc in there home directory. They store the individual settings for that users. There is a global file in /etc/profile. As far as group names are concerned they are stored in a file under the /etc directory(/etc/group) RHEL4 has a gui tool if you prefer under system settings called users and groups. Again this is if I understand you correctly.
0
 
pjedmondConnect With a Mentor Commented:
Nice little overview of users and groups:

http://yolinux.com/TUTORIALS/LinuxTutorialManagingGroups.html

although written for yolinux, it is equally applicable to other distros.

(   (()
(`-' _\
 ''  ''
0
 
pjedmondCommented:
>What are the generally recognized files used set up aliases that a user will have when s/he logs in, and >that won't get overwritten on some update?

>What is the generally recognized file used for global aliases, that won't get overwritten on some update?

I presume that you are referring to /etc/aliases, but this is for sendmail

man aliases

for more info.

(   (()
(`-' _\
 ''  ''

0
 
bryanlloydharrisConnect With a Mentor Commented:
There are many files for this.  Some global and some only for the user.  User settings override global settings AFAIK.

global:
/etc/profile
/etc/bashrc (this is not on my system but it's on the one at work)

not-global(these are only for the bryan user):
/home/bryan/.bash_profile
/home/bryan/.bashrc

Since I'm a beginner, my config looks like this, to simplify things.  This way, it doesn't matter much because they are both the same:

$ vi .bashrc (and put in your settings)
$ ln -s .bashrc .bash_profile (this makes them both the same)

/home/.bash_profile -> .bashrc (this means it's a symlink, both files have same content)

So if you do "cat .bashrc" and then "cat .bash_profile" they will both be the same.  Sometimes the shell reads .bashrc and sometimes .bash_profile.  It depends if you login at console, remote ssh, or xterm, and so on.  To make things simple, I read a book which says create a symlink and don't worry about it because they are then all the same.  I can't remember the name of the book but it might be "Linux Hacks."
0
 
pjedmondCommented:
Example .bashrc
-----------------8X------------------
[pje@bigserver pje# cat .bashrc
# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
-----------------8X------------------

As you can see, this file creates a number of user specific aliases and also runs /etc/bashrc. The 'default' home set up for a new user normally exists in the /etc/skel directory. By having this default setup copied into the home directory of a new user, then you could change 'alias' directives for all users using bash sh by editing /etc/bashrc

(   (()
(`-' _\
 ''  ''
0
All Courses

From novice to tech pro — start learning today.