Results 1 to 10 of 10

Thread: Linux "ls" command switch

  1. #1
    Ultimate Member rraehal's Avatar
    Join Date
    Jan 2002
    Location
    Denver, Colorado, USA
    Posts
    3,874

    Linux "ls" command switch

    I am using linux with a bash shell. My ls command quit showing color by default. I can type "ls --color=always" to get color directory lists.

    Is there a command I can put in the .bashrc file for my profile to make this happen by default again (or perhaps the /etc/.bashrc for every user).

    Thanks.
    -- Mathias

  2. #2
    Ultimate Member richard_cocks's Avatar
    Join Date
    Mar 2002
    Posts
    1,199
    you could alias ls to ls --color=always, but there's almost something more subtle going on somewhere that should addressed.

  3. #3
    Ultimate Member rraehal's Avatar
    Join Date
    Jan 2002
    Location
    Denver, Colorado, USA
    Posts
    3,874
    This is just weird. I know I caused the problem, I simply do not knwo what I did. I will reinstall Linux eventually and everything will be fine, but until then, I want to continue to experiment and see how things work.

    I did try the alias command in my .bashrc but it doesn't work in runlevel 3. If I manually alias the command it works in runlevel 3.

    Since adding the alias command to my .bashrc, X Terminal displays in color again.
    -- Mathias

  4. #4
    PC Aficionado MJCfromCT's Avatar
    Join Date
    Jun 2003
    Posts
    4,726
    Would something like this help?

    #
    # Show color-coded file types.
    alias ls='ls --color=yes'
    #

    http://www.hk8.org/old_web/linux/lnut/ch07_01.htm

    *Edit* It would help if i read the last sentence of your post

  5. #5
    Ultimate Member rraehal's Avatar
    Join Date
    Jan 2002
    Location
    Denver, Colorado, USA
    Posts
    3,874
    I guess I will forget it for now. (At least until I reinstall Mandrake).

    I should be more careful when changing things. I have no idea how I broke it.



    BTW:The command you have listed in you post is one of 3 I have tried. I have tries yes, auto, and always.
    -- Mathias

  6. #6
    Member
    Join Date
    Aug 2000
    Location
    Long Valley, NJ USA
    Posts
    60
    Check your login directory for a .dir_colors file.

    In my case I don't want the colors - I find them distracting - so I set the "COLOR tty" line to "COLOR none".

    Has your file gone away?
    Did you have one?
    Has someone mucked with a /etc/... global copy?

    You could check for that kind of stuff.
    Geo. S.

  7. #7
    Ultimate Member rraehal's Avatar
    Join Date
    Jan 2002
    Location
    Denver, Colorado, USA
    Posts
    3,874
    I would be the person who mucked it up. I have a /etc/dir_colors and I have a ~/.dir_colors.

    The files seem to be identical. I will manually alias the command to show colors when I need to until I find time to reinstall. Maybe I should get some new ISO's. I am using Mandrake 9 now and was using Fedora for a short while. I have a real SuSE 9.1 CD. Maybe I will try that flavor next.
    -- Mathias

  8. #8
    Senior Member
    Join Date
    Apr 2002
    Posts
    661
    what did you think of fedora?

  9. #9
    Ultimate Member rraehal's Avatar
    Join Date
    Jan 2002
    Location
    Denver, Colorado, USA
    Posts
    3,874
    Fedora seemed to be lacking in some areas that Mandrake covered is the only thing I am remembering at the moment. I only used Fedora 3 or 4 times so my opinion is still skewed. The last Redhat version I used for a length of time was 6.

    I had reinstalled Windows so I simply reinstalled Mandrake because it was what I was used to.

    [EDIT]
    I just looked and I used Fedora Core 1 and currently Core 3 is the latest so my opinion of fedora is outdated.
    Last edited by rraehal; 09-30-2004 at 07:02 PM.
    -- Mathias

  10. #10
    Senior Member
    Join Date
    Apr 2002
    Posts
    661
    I'm using redhat 8 and was considering fedora since it would be less outdated? What Kinds of things does mandrake give you that it didnt' have?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •