View previous topic :: View next topic |
Author |
Message |
squanto Guru
Joined: 20 Apr 2002 Posts: 524 Location: Rochester, NY, USA
|
Posted: Tue Aug 27, 2002 1:05 am Post subject: type "ls" have "ls --color" happen |
|
|
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 |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20067
|
Posted: Tue Aug 27, 2002 1:11 am Post subject: |
|
|
You do know that ln is already an existing command? 'man ln' for info. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Tue Aug 27, 2002 1:20 am Post subject: |
|
|
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 |
|
|
sa Guru
Joined: 10 Jun 2002 Posts: 450
|
Posted: Tue Aug 27, 2002 1:20 am Post subject: |
|
|
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 |
|
|
squanto Guru
Joined: 20 Apr 2002 Posts: 524 Location: Rochester, NY, USA
|
Posted: Tue Aug 27, 2002 1:31 am Post subject: |
|
|
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 |
|
|
Chris W l33t
Joined: 25 Jun 2002 Posts: 972 Location: Brisbane, Australia
|
Posted: Tue Aug 27, 2002 11:08 am Post subject: |
|
|
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 |
|
|
squanto Guru
Joined: 20 Apr 2002 Posts: 524 Location: Rochester, NY, USA
|
Posted: Tue Aug 27, 2002 12:35 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
Guest
|
Posted: Wed Aug 28, 2002 12:40 am Post subject: for root? |
|
|
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
Joined: 19 Apr 2002 Posts: 2391 Location: Wisconsin (USA)
|
Posted: Wed Aug 28, 2002 1:52 am Post subject: |
|
|
Why not try and find out?
Yeah, I think that's all you need. |
|
Back to top |
|
|
|