LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 03-02-2013, 09:54 AM   #1
johnmtb
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.

regards,

john
 
Old 03-02-2013, 10:08 AM   #2
GazL
Senior Member
 
Registered: May 2008
Posts: 3,475

Rep: Reputation: 1014Reputation: 1014Reputation: 1014Reputation: 1014Reputation: 1014Reputation: 1014Reputation: 1014Reputation: 1014
Change COLOR=auto to COLOR=always in /etc/profile.d/coreutils-dircolors.sh

Or override the alias in your own .bashrc (which would be my preference)
 
2 members found this post helpful.
Old 03-02-2013, 01: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: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950
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.
  


Reply


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 04:48 PM
If Linux had a colour what would it be? perry General 24 02-19-2005 09:18 PM
Colour schemes Law1213 Linux - General 2 08-31-2004 03:28 PM
how do i do this in installing colour? santasballz Linux - Newbie 1 02-29-2004 06:06 PM
why is X 24bit colour? Jestrik Linux - General 9 01-14-2004 08:07 AM


All times are GMT -5. The time now is 11:25 PM.

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