LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-04-2009, 12:25 AM   #1
johnmtb
LQ Newbie
 
Registered: Sep 2008
Posts: 14

Rep: Reputation: 0
colouring ls -al|more


Dear all,

although i have DIR_COLORS showing COLOR all,

when i run ls -al|more, there are no colors.

please halp.

regards,

john
 
Old 01-04-2009, 01:01 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
more is a very old and limited pager. I don't think it even has the ability to show colors. less will display color codes though, if you run it with the -r or -R options. "ls -al | less -r"
 
Old 01-04-2009, 01:03 AM   #3
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 71
To get colors in the output of ls, you need to call it with the --color option. Like this:

ls --color

If you want ls to display listings in color all the time, you can add the following line to your .bashrc file (in your home directory)

alias ls="ls --color"

Then, open a new terminal and check if it works.
 
Old 01-04-2009, 01:10 AM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
To get colors in the output of ls, you need to call it with the --color option. Like this:
there is color with ls -a
not with ls -a|more
 
Old 01-04-2009, 06:17 AM   #5
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,299
Blog Entries: 61

Rep: Reputation: Disabled
Irrelevant, but someone once said:
Quote:
less is more, but more more than more is, so more is less less, so use more less if you want less more.
 
Old 01-04-2009, 11:38 PM   #6
johnmtb
LQ Newbie
 
Registered: Sep 2008
Posts: 14

Original Poster
Rep: Reputation: 0
All,

thank you for your input, i will try your suggestions.

however, i am surprised that this method, ls -al|more (with Color All in DIR_COLORS) is no longer supported. ever since colour was first introduced into Slackware Linux, i have used this command, without any problems. when did it all change?

regards,

john
 
  


Reply



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
Colouring widgets in glade using C sneha hendre Programming 2 10-06-2008 09:12 AM
Colouring things in Linux/Shell Vampirite Linux - General 3 02-19-2006 07:28 AM
Shell Prompts and root ls colouring iantri Slackware 10 09-11-2003 08:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:00 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration