Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
type "ls" have "ls --color" happen
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
squanto
Guru
Guru


Joined: 20 Apr 2002
Posts: 524
Location: Rochester, NY, USA

PostPosted: Tue Aug 27, 2002 1:05 am    Post subject: type "ls" have "ls --color" happen Reply with quote

I was wondering how to link "ls --color" to happen everytime I type "ls" so that I can have pretty colors on my console.
Some type of soft link I would assume?

Thanks,
Andrew

edit! Thank you to rac!


Last edited by squanto on Tue Aug 27, 2002 1:29 am; edited 1 time in total
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Tue Aug 27, 2002 1:11 am    Post subject: Reply with quote

You do know that ln is already an existing command? 'man ln' for info.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Tue Aug 27, 2002 1:20 am    Post subject: Reply with quote

Are you sure you don't mean 'ls', for directory listings? See here and if you want to respond here, do it fast, because I bet kanuslupus will come along and lock this thread fairly quickly. :)
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
sa
Guru
Guru


Joined: 10 Jun 2002
Posts: 450

PostPosted: Tue Aug 27, 2002 1:20 am    Post subject: Reply with quote

You mean 'ls' right? you just need to add an alias to your shell rc file, probable ~/.bashrc
alias ls='ls -F --color=auto'
alias ll='ls -lhF --color=auto'
alias la='ls -aF --color=auto'

hth,
sa
Back to top
View user's profile Send private message
squanto
Guru
Guru


Joined: 20 Apr 2002
Posts: 524
Location: Rochester, NY, USA

PostPosted: Tue Aug 27, 2002 1:31 am    Post subject: Reply with quote

thank you. I thought kanuslupus was being kind of rude, until I realized I was being an idiot and typing the wrong thing.
Sorry bout that.
Back to top
View user's profile Send private message
Chris W
l33t
l33t


Joined: 25 Jun 2002
Posts: 972
Location: Brisbane, Australia

PostPosted: Tue Aug 27, 2002 11:08 am    Post subject: Reply with quote

Correct me if I've missed something, but the default Gentoo .bashrc file already provides this alias.
Code:
 # Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/skel/.bashrc,v 1.5 2002/08/07 18:13:35 azarah E
xp $

# This file is sourced by all *interactive* bash shells on startup.  This
# file *should generate no output* or it will break the scp and rcp commands.

# colors for ls, etc.
eval `dircolors -b /etc/DIR_COLORS`
alias d="ls --color"
alias ls="ls --color=auto"
alias ll="ls --color -l"

_________________
Cheers,
Chris W
"Common sense: The collection of prejudices acquired by age 18." -- Einstein
Back to top
View user's profile Send private message
squanto
Guru
Guru


Joined: 20 Apr 2002
Posts: 524
Location: Rochester, NY, USA

PostPosted: Tue Aug 27, 2002 12:35 pm    Post subject: Reply with quote

Yes, I am pretty sure that it does, but not for root. I like the colors cause it makes finding the file I want easier and it is easier for me to navigate around the fs. I didn't know how to set it up, but now I do.

Thanks :mrgreen:
Back to top
View user's profile Send private message
Guest






PostPosted: Wed Aug 28, 2002 12:40 am    Post subject: for root? Reply with quote

You say not for root. If I add that to my .bashrc, should it work as root?

Code:
alias ls="ls --color=auto"


That's in my .bashrc. Do I need more to get it to work?
Back to top
BradN
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2391
Location: Wisconsin (USA)

PostPosted: Wed Aug 28, 2002 1:52 am    Post subject: Reply with quote

Why not try and find out? :)

Yeah, I think that's all you need.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum