You are not logged in.

#1 2012-01-25 11:10:12

davidshen84
Member
Registered: 2012-01-25
Posts: 8

How to set 'ls' with --color by default?

Hi,

I know one way is to use the 'alias' command to define an alias for 'ls --color'. I remember there's other way. Can some one give me a hint?

Offline

#2 2012-01-25 11:19:06

blindcarnt
Member
Registered: 2011-10-23
Posts: 16

Re: How to set 'ls' with --color by default?

You just need to make an alias.  Open your ~/.bashrc (or /home/user/.bashrc) and add this

alias ls='ls --color=auto'

Personally I use

alias ls='ls -ahl --color=auto'

smile


Intel inside, idiot outside.

Offline

#3 2012-01-25 11:33:17

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: How to set 'ls' with --color by default?

You can learn about all customization options, including the use of colour, when you type:

man ls

:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#4 2012-01-25 13:31:58

owain
Member
Registered: 2009-08-24
Posts: 251

Re: How to set 'ls' with --color by default?

For masses of extra colors, take a look here: https://github.com/trapd00r/LS_COLORS

Offline

Board footer

Powered by FluxBB