Find the answer to your Linux question:
Results 1 to 3 of 3
How do I get ls to always be ls --color=yes? Is it aliases? I can't get ls --color=always to work. Can you guys help me out?...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2003
    Posts
    12

    LS Color


    How do I get ls to always be ls --color=yes? Is it aliases? I can't get ls --color=always to work. Can you guys help me out?

  2. #2
    Linux Engineer
    Join Date
    Sep 2003
    Location
    Knoxhell, TN
    Posts
    1,078
    edit /etc/profile and add this line somewhere:
    Code:
    alias ls='ls --color'
    Their code will be beautiful, even if their desks are buried in 3 feet of crap. - esr

  3. #3
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    You might want this instead, though:
    Code:
    alias ls='ls --color=tty'
    Otherwise, it will insert color escape sequences even if you pipe the output to something else.

Posting Permissions

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