LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-23-2006, 01:17 PM   #1
Wynd
Member
 
Registered: Jul 2001
Distribution: Slackware 12
Posts: 511

Rep: Reputation: 32
ls colors messing up pipes


When I try to do anything involving the command `ls`; I get weird escape sequences that I an guessing refer to the colors, because --color=no gets rid of them.

For example, ls / | less gives me this:
Code:
ESC[00mESC[01;34mbinESC[00m/
ESC[01;34mbootESC[00m/
ESC[01;34mdevESC[00m/
ESC[01;34metcESC[00m/
ESC[01;34mhomeESC[00m/
ESC[01;34mlibESC[00m/
ESC[01;34mlost+foundESC[00m/
ESC[01;34mmntESC[00m/
ESC[01;34moptESC[00m/
ESC[01;34mprocESC[00m/
ESC[01;34mrootESC[00m/
ESC[01;34msbinESC[00m/
ESC[01;34msysESC[00m/
ESC[01;34mtmpESC[00m/
ESC[01;34musrESC[00m/
ESC[01;34mvarESC[00m/
ESC[m
How can I fix that? I've never had this happen to me before.
 
Old 04-23-2006, 05:57 PM   #2
ataraxia
Member
 
Registered: Apr 2006
Location: Pittsburgh
Distribution: Debian Sid AMD64
Posts: 296

Rep: Reputation: 30
You should use "--color=auto" in any aliases for ls. That way you get color when the output is going directly to a terminal, but not when it's going into a file or pipe.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
about pipes kpachopoulos Programming 1 10-15-2005 12:37 PM
Pipes, understanded. andresv LinuxQuestions.org Member Success Stories 0 05-05-2005 10:45 PM
devices and pipes siemens Linux - General 1 03-23-2005 03:30 AM
Interleaving using pipes AquamaN Programming 1 09-28-2003 04:59 PM
Use of Named Pipes casey0999 Linux - Software 3 08-03-2003 01:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:39 AM.

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