Skip to main content
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
Source Link

I know that a similar question has been asked in:

How to colorize output of ls ?How to colorize output of ls ?

although I didn't really understand the answer and couldn't really make it work.

However, I have tried something different. I decided to read the manual page for ls and it mentions different environment variables that can be set when dealing with the ls command. If one goes to the -G option it says to look at the CLICOLOR environment variables. I did and that one links you to documentation for the LSCOLORS environment variable. I went to it and it mentions:

"The value of this variable describes what color to use for which attribute when colors are enabled with CLICOLOR. This string is a concatenation of pairs of the format fb, where f is the foreground color and b is the background color. "

It also mentions that the default value of LSCOLORS is "exfxcxdxbxegedabagacad" and that each part specifies the color of some specific thing in the ls command. For example, the first pair ex in example specifies the color of directories. the second fx the color of symbolic links etc... e means blue and x means default "foreground".

  1. First what does this mean: "when colors are enabled with CLICOLOR"?

  2. What does "foreground" mean?

What must environment variables be for the ls command to color the output however I desire?


I also tried:

ls --color 

But it threw me the following error:

ls: illegal option -- - usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...] 

The same error happened when I did ls --color=auto: it alone also throws an error. I have no idea why, and am not sure if it was due to iTerm2 or OS X or why that happened. It seems it works on other systems...

I know that a similar question has been asked in:

How to colorize output of ls ?

although I didn't really understand the answer and couldn't really make it work.

However, I have tried something different. I decided to read the manual page for ls and it mentions different environment variables that can be set when dealing with the ls command. If one goes to the -G option it says to look at the CLICOLOR environment variables. I did and that one links you to documentation for the LSCOLORS environment variable. I went to it and it mentions:

"The value of this variable describes what color to use for which attribute when colors are enabled with CLICOLOR. This string is a concatenation of pairs of the format fb, where f is the foreground color and b is the background color. "

It also mentions that the default value of LSCOLORS is "exfxcxdxbxegedabagacad" and that each part specifies the color of some specific thing in the ls command. For example, the first pair ex in example specifies the color of directories. the second fx the color of symbolic links etc... e means blue and x means default "foreground".

  1. First what does this mean: "when colors are enabled with CLICOLOR"?

  2. What does "foreground" mean?

What must environment variables be for the ls command to color the output however I desire?


I also tried:

ls --color 

But it threw me the following error:

ls: illegal option -- - usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...] 

The same error happened when I did ls --color=auto: it alone also throws an error. I have no idea why, and am not sure if it was due to iTerm2 or OS X or why that happened. It seems it works on other systems...

I know that a similar question has been asked in:

How to colorize output of ls ?

although I didn't really understand the answer and couldn't really make it work.

However, I have tried something different. I decided to read the manual page for ls and it mentions different environment variables that can be set when dealing with the ls command. If one goes to the -G option it says to look at the CLICOLOR environment variables. I did and that one links you to documentation for the LSCOLORS environment variable. I went to it and it mentions:

"The value of this variable describes what color to use for which attribute when colors are enabled with CLICOLOR. This string is a concatenation of pairs of the format fb, where f is the foreground color and b is the background color. "

It also mentions that the default value of LSCOLORS is "exfxcxdxbxegedabagacad" and that each part specifies the color of some specific thing in the ls command. For example, the first pair ex in example specifies the color of directories. the second fx the color of symbolic links etc... e means blue and x means default "foreground".

  1. First what does this mean: "when colors are enabled with CLICOLOR"?

  2. What does "foreground" mean?

What must environment variables be for the ls command to color the output however I desire?


I also tried:

ls --color 

But it threw me the following error:

ls: illegal option -- - usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...] 

The same error happened when I did ls --color=auto: it alone also throws an error. I have no idea why, and am not sure if it was due to iTerm2 or OS X or why that happened. It seems it works on other systems...

fix a typo and grammar
Source Link
iruvar
  • 17k
  • 8
  • 51
  • 81

I know that a similar question has been askrfasked in:

How to colorize output of ls ?

although I didn't really understand the answer and couldn't really make it work.

However, I have tried something different. I decided to read the manual page for ls and it mentions different environment variables that can be set when dealing with the ls command. If one goes to the -G option it says to look at the CLICOLOR environment variables. I did and that one links you to documentation for the LSCOLORS environment variable. I went to it and it mentions:

"The value of this variable describes what color to use for which attribute when colors are enabled with CLICOLOR. This string is a concatenation of pairs of the format fb, where f is the foreground color and b is the background color. "

It also mentions that the default value of LSCOLORS is "exfxcxdxbxegedabagacad" and that each part specifies the color of some specific thing in the ls command. For example, the first pair ex in example specifies the color of directories. the second fx the color of symbolic links etc... e means blue and x means default "foreground".

  1. First what does this mean: "when colors are enabled with CLICOLOR"?

  2. What does "foreground" mean?

What must environment variables be for the ls command to color the output however I desire?


I also tried:

ls --color 

But it threw me the following error:

ls: illegal option -- - usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...] 

The same error happened when I did ls --color=auto: it alone also throws an error. I have no idea why, and am not sure if it was due to iTerm2 or OS X or why that happened. It seems it works on other systems...

I know that a similar question has been askrf in:

How to colorize output of ls ?

although I didn't really understand the answer and couldn't really make it work.

However, I have tried something different. I decided to read the manual page for ls and it mentions different environment variables that can be set when dealing with the ls command. If one goes to the -G option it says to look at the CLICOLOR environment variables. I did and that one links you to documentation for the LSCOLORS environment variable. I went to it and it mentions:

"The value of this variable describes what color to use for which attribute when colors are enabled with CLICOLOR. This string is a concatenation of pairs of the format fb, where f is the foreground color and b is the background color. "

It also mentions that the default value of LSCOLORS is "exfxcxdxbxegedabagacad" and that each part specifies the color of some specific thing in the ls command. For example, the first pair ex in example specifies the color of directories. the second fx the color of symbolic links etc... e means blue and x means default "foreground".

  1. First what does this mean: "when colors are enabled with CLICOLOR"?

  2. What does "foreground" mean?

What must environment variables be for the ls command to color the output however I desire?


I also tried:

ls --color 

But it threw me the following error:

ls: illegal option -- - usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...] 

The same error happened when I did ls --color=auto: it alone also throws an error. I have no idea why, and am not sure if it was due to iTerm2 or OS X or why that happened. It seems it works on other systems...

I know that a similar question has been asked in:

How to colorize output of ls ?

although I didn't really understand the answer and couldn't really make it work.

However, I have tried something different. I decided to read the manual page for ls and it mentions different environment variables that can be set when dealing with the ls command. If one goes to the -G option it says to look at the CLICOLOR environment variables. I did and that one links you to documentation for the LSCOLORS environment variable. I went to it and it mentions:

"The value of this variable describes what color to use for which attribute when colors are enabled with CLICOLOR. This string is a concatenation of pairs of the format fb, where f is the foreground color and b is the background color. "

It also mentions that the default value of LSCOLORS is "exfxcxdxbxegedabagacad" and that each part specifies the color of some specific thing in the ls command. For example, the first pair ex in example specifies the color of directories. the second fx the color of symbolic links etc... e means blue and x means default "foreground".

  1. First what does this mean: "when colors are enabled with CLICOLOR"?

  2. What does "foreground" mean?

What must environment variables be for the ls command to color the output however I desire?


I also tried:

ls --color 

But it threw me the following error:

ls: illegal option -- - usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...] 

The same error happened when I did ls --color=auto: it alone also throws an error. I have no idea why, and am not sure if it was due to iTerm2 or OS X or why that happened. It seems it works on other systems...

How to change the output color of the ls commancommand in terminal in OS X and iTerm2?

I know that a similar question has been asaskrf in:

How to colorize output of ls ?

Though,although I didn't really understand the answer and couldn't really make it work.

However, I have tried something different. I decided to read the manual page for lsls and it mentions different environmentsenvironment variables that can be set when dealing with the lsls command. If one goes to the -G-G option it says to look at the CLICOLORCLICOLOR environment variables. So I did and thatthat one links you to documentation for the LSCOLORSLSCOLORS environment variable. So I went to it and it mentions:

"The value of this variable describes what color to use for which attribute when colors are enabled with CLICOLOR. This string is a concatenation of pairs of the format fb, where f is the foreground color and b is the background color. "

It also mentions that the default value of LSCOLORS is "exfxcxdxbxegedabagacad" and that each part specifies the color of some specific thing in the ls comandcommand. For examleexample, the first pair ex in example specifies the color of directories. the second fx the color of symbolic links etc... e means blue and x means default "foreground".

  1. First what does this mean: "when colors are enabled with CLICOLOR"?

  2. What does foreground"foreground" mean?

What do themust environment variables need to be for the lsls command to color the output however I desire?


I also tried:

ls --color 

But it threw me the following error:

ls: illegal option -- - usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...] 

theThe same error happened when I did ls --color=auto: it alone also throws an error. NoI have no idea why, and am not sure if it was due to iTerm2 or OS X or why that happened. It seems it works on other systems...

How to change the output color of ls comman in terminal in OS X and iTerm2?

I know that a similar question has been as in:

How to colorize output of ls ?

Though, I didn't really understand the answer and couldn't really make it work.

However, I have tried something different. I decided to read the manual page for ls and it mentions different environments variables that can be set when dealing with the ls command. If one goes to the -G option it says to look at the CLICOLOR environment variables. So I did and that one links you to documentation for the LSCOLORS environment variable. So I went to it and it mentions:

"The value of this variable describes what color to use for which attribute when colors are enabled with CLICOLOR. This string is a concatenation of pairs of the format fb, where f is the foreground color and b is the background color. "

It also mentions that the default value of LSCOLORS is "exfxcxdxbxegedabagacad" and that each part specifies the color of some specific thing in the ls comand. For examle, the first pair ex in example specifies the color of directories. the second fx the color of symbolic links etc... e means blue and x means default "foreground".

  1. First what does "when colors are enabled with CLICOLOR"?

  2. What does foreground mean?

What do the environment variables need to be for the ls command to color the output however I desire?


I also tried:

ls --color 

But it threw me the following error:

ls: illegal option -- - usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...] 

the same error happened when I did ls --color=auto alone also throws an error. No idea why, not sure if it was due to iTerm2 or OS X or why that happened. It seems it works on other systems...

How to change the output color of the ls command in terminal in OS X and iTerm2?

I know that a similar question has been askrf in:

How to colorize output of ls ?

although I didn't really understand the answer and couldn't really make it work.

However, I have tried something different. I decided to read the manual page for ls and it mentions different environment variables that can be set when dealing with the ls command. If one goes to the -G option it says to look at the CLICOLOR environment variables. I did and that one links you to documentation for the LSCOLORS environment variable. I went to it and it mentions:

"The value of this variable describes what color to use for which attribute when colors are enabled with CLICOLOR. This string is a concatenation of pairs of the format fb, where f is the foreground color and b is the background color. "

It also mentions that the default value of LSCOLORS is "exfxcxdxbxegedabagacad" and that each part specifies the color of some specific thing in the ls command. For example, the first pair ex in example specifies the color of directories. the second fx the color of symbolic links etc... e means blue and x means default "foreground".

  1. First what does this mean: "when colors are enabled with CLICOLOR"?

  2. What does "foreground" mean?

What must environment variables be for the ls command to color the output however I desire?


I also tried:

ls --color 

But it threw me the following error:

ls: illegal option -- - usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...] 

The same error happened when I did ls --color=auto: it alone also throws an error. I have no idea why, and am not sure if it was due to iTerm2 or OS X or why that happened. It seems it works on other systems...

added 371 characters in body
Source Link
Charlie Parker
  • 1.6k
  • 3
  • 18
  • 32
Loading
edited tags
Link
Gilles 'SO- stop being evil'
  • 866.1k
  • 205
  • 1.8k
  • 2.3k
Loading
Source Link
Charlie Parker
  • 1.6k
  • 3
  • 18
  • 32
Loading