1837631 Members
3280 Online
110117 Solutions
New Discussion

Re: root login aliases

 
Jim Mickens_2
Occasional Advisor

root login aliases

Where can I create aliases so that root will use them when I log in. I'm
getting tired of retyping long commonly used commands. All of the users have a
.login in their /home directory, but there isn't one for root. Maybe I'm just
being a dolt, but I can't figure it out.
4 REPLIES 4
Glenn Wagner_1
Occasional Advisor

Re: root login aliases

Assuming that root is running some type of bourne shell, include the aliases
the the .profile in root's home directory.

Or, you can create an alias file containing all you aliases. In root's startup
file (.profile), source the alias file.

I.E. ". ~root/.aliases"
Jim Mickens_2
Occasional Advisor

Re: root login aliases

Root doesn't appear to be going into any kind of a shell. Does that make a
difference? I tried entering the alias after logging in and it doesn't seem to
work unless I do a 'csh' first.
Glenn Wagner_1
Occasional Advisor

Re: root login aliases

In your password file, the entry for root should contain the shell as the last
field. In 10.20 it is /sbin/sh by default.
Are you trying to use the csh syntax for the alias? The syntax in the bourne
or korn or posix shell is different. Here is an example.
csh: alias ls ls -la
sh: alias ls="ls -la"
I hope this helps.

Jim Mickens_2
Occasional Advisor

Re: root login aliases

That was it. Thanks.