LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-02-2003, 05:57 PM   #1
whaase
Member
 
Registered: Aug 2002
Location: Calgary, Alberta, Canada
Distribution: Ubuntu Server, Ubuntu Desktop
Posts: 128

Rep: Reputation: 15
alias and .bashrc


I wanted my ls command to have color, so I entered the following command in the /home/USER/.bashrc file

alias "ls=ls --color=always"

Worked great. But I did the same for root in the /root/.bashrc

alias "ls=ls --color=always"

It won't work... I've tried the following aswell:

alias 'ls=ls --color'
alias ls=ls --color
alias "ls=ls --color"

Nothing... if I type it in the shell it works.... Anyone know where I'm messing up?

Walter
 
Old 11-02-2003, 06:43 PM   #2
dkloes
Member
 
Registered: Oct 2003
Posts: 66

Rep: Reputation: 15
Try:
alias ls='ls --color'
 
Old 11-02-2003, 06:43 PM   #3
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Re: alias and .bashrc

Quote:
Originally posted by whaase
I wanted my ls command to have color, so I entered the following command in the /home/USER/.bashrc file

alias "ls=ls --color=always"

Worked great. But I did the same for root in the /root/.bashrc

alias "ls=ls --color=always"

It won't work... I've tried the following aswell:

alias 'ls=ls --color'
alias ls=ls --color
alias "ls=ls --color"

Nothing... if I type it in the shell it works.... Anyone know where I'm messing up?

Walter
Here is what I have in my /root/.bashrc:
Code:
# You may uncomment the following lines if you want `ls' to be colorized:
export LS_OPTIONS='--color=auto -h'
eval `dircolors`
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'
#
You will also want to check in your /root/.profile for this:
Code:
if [ -f ~/.bashrc ]; then
  . ~/.bashrc
fi
To make sure the .bashrc is being sourced when you go to root.
 
Old 11-02-2003, 07:03 PM   #4
whaase
Member
 
Registered: Aug 2002
Location: Calgary, Alberta, Canada
Distribution: Ubuntu Server, Ubuntu Desktop
Posts: 128

Original Poster
Rep: Reputation: 15
Thank you! it worked... I didn't have a .profile, so I ust made one..

Walter
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
using 'watch' on an alias in .bashrc slackist Linux - General 11 01-29-2016 01:09 PM
adding perm. alias to .bashrc Lleb_KCir Linux - General 7 12-09-2004 02:35 PM
making alias, can't find .bashrc file djgerbavore Slackware 10 07-23-2004 08:23 AM
My first alias in .bashrc...'apostrophes 'getting' in the way?' Baix Linux - Newbie 3 06-17-2004 02:36 PM
alias and bashrc Haldir Linux - Newbie 3 06-14-2002 05:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration