LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   root question (https://www.linuxquestions.org/questions/linux-general-1/root-question-47776/)

spuppett 03-01-2003 03:04 PM

root question
 
I made an alias in my .bashrc file for ls. really simple, its lst="ls -l". works like it should. when i am root it doesn't work, that makes sense, but is there a place where I can do something similar for root, or do i need to make it a script?

Thanks.

fancypiper 03-01-2003 03:10 PM

Edit the /root/.bashrc file :D

Each user has one in their home directory. Here is mine
Code:

# fancypiper ./.bashrc for user phil
# User specific aliases and functions

alias x='dial ; fetchmail ; startx'

# Become full root
alias god='su -'

# Alter the ls command
alias ls='ls -a'
alias lls='ls -la'

# Connect/disconnect the internet by modem
alias dial='/sbin/ifup ppp0'
alias hangup='/sbin/ifdown ppp0'

# Launch links with my linux links page
alias links='links /home/phil/bookmarks.html'

# Power down/reboot
alias off='shutdown -h now'
alias boot='shutdown -r now'

# For Redhat editor because I forget which one I use in which distro
alias pico='pico -w'
alias nano='pico -w'

# For Gentoo editor because I forget which one I use in which distro
# alias pico='nano -w'
# alias nano='nano -w'

# This script needs to be on the bottom of the file or RH updates will fsck it up
# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi


spuppett 03-01-2003 03:17 PM

Thanks, I thought there would be something like that. I thought I looked, but I guess i looked in the wrong spot? As soon as I get my other problem fixed, i'll try that.

Crashed_Again 03-01-2003 03:37 PM

Just a little FYI here. If you want the alias to be available to ALL users on the machine then you could add the alias line to the bottom of the /etc/bashrc file assuming you are using bash.

By the way I like some of your alias Fancypiper. Can I use some of those or do I need to pay for a product key to use those? ;)

spuppett 03-01-2003 05:18 PM

Thank you much. I knew it was just something I was overlooking.


All times are GMT -5. The time now is 01:04 AM.