[LBo] section 3.3.3.2. Which

Anita Lewis a.lewis at linuxbasics.org
Mon Nov 6 12:15:40 CET 2006


On 11/06/2006 12:55 AM Ray wrote:
> gerrit:~> which -a ls
> ls is aliased to `ls -F --color=auto'
> ls is /bin/ls
>
> using kubuntu edgy I get the following:
>
> ray at dev:~$ which -a ls
> /bin/ls
>
> the output of a "ls" command looks like the color option is applied, but not 
> the -F option.
> Shell is BASH
>
> [ray at dev:~$ echo $SHELL
> /bin/bash]h
>
> can anybody explain what is going on
>   
I put in a bug report to ubuntu on the question of 'which' because 
according to the author of which, the alias should still be shown.  I'll 
report if/when I get anything back. I can see that they have trimmed 
down the manpage considerably from what is available online, but I don't 
know if this was done at the Ubuntu level, or higher up at Debian.  
'which' is a part of the debianutils package.  It is possible that this 
has been the way 'which' works in Debian for years.  I've never done 
'which -a' prior to this course. 

The -F option is set on some systems, but I've not seen it set on 
Debian/Ubuntu. You can add '-F' to your alias for ls in ~/.bashrc:

     alias ls='ls -F --color=auto'

The color actually is an alternative to using the -F, I think.  For the 
purposes of the course, you could use that above alias command in a 
terminal to set '-F' temporarily and look around at the various suffixes 
on files.

Anita



More information about the QnA mailing list