Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 03-02-2013, 08:54 AM   #1
LQ Newbie
Registered: Sep 2008
Posts: 14

Rep: Reputation: 0
Colour with ls -al|more

Dear All,

i have already included colours when i issue the ls -al command, but the colours disappear when i modify that command as follows: ls -al|more.

there used to be a method of adding colours when issuing this command, but i forget it and cannot find any reference to it anymore.

i have been using Slackware Linux since 1992, i believe it was version 1.2, or 2.1 and i love the command screen, but i do want colour all the way.

please help me get abck my colour when issuing the ls -al|more command.


Old 03-02-2013, 09:08 AM   #2
Senior Member
Registered: May 2008
Posts: 4,330
Blog Entries: 7

Rep: Reputation: 1778Reputation: 1778Reputation: 1778Reputation: 1778Reputation: 1778Reputation: 1778Reputation: 1778Reputation: 1778Reputation: 1778Reputation: 1778Reputation: 1778
Change COLOR=auto to COLOR=always in /etc/profile.d/

Or override the alias in your own .bashrc (which would be my preference)
2 members found this post helpful.
Old 03-02-2013, 12:06 PM   #3
David the H.
Bash Guru
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959
Console colors are produced through the use of ansi escape codes, a kind of embedded mark-up text that controls the way the console display behaves.

This requires both the output program to be able to produce the embedded codes, and the displaying program to be able to interpret them. So you generally need to ensure that both programs have their respective "color" options enabled (if any).

Most console programs like ls are smart enough not to embed escape codes when their output is being sent through pipes or file redirections (you usually do not want such extraneous characters in command inputs or raw text files). That's the behavior of the "--color=auto" option. Changing it to "--color=always" forces it to embed the codes no matter what the output target is.

As for the display program, I think more just relies on the terminal itself for its display, but other programs often need to have it explicitly enabled. less, for example, uses the "-R" option to enable ansi color interpretation.
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Colour Problem dejai Slackware 1 02-10-2009 03:48 PM
If Linux had a colour what would it be? perry General 24 02-19-2005 08:18 PM
Colour schemes Law1213 Linux - General 2 08-31-2004 02:28 PM
how do i do this in installing colour? santasballz Linux - Newbie 1 02-29-2004 05:06 PM
why is X 24bit colour? Jestrik Linux - General 9 01-14-2004 07:07 AM

All times are GMT -5. The time now is 03:29 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration