Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
ls problem with matlab 2009a in ubuntu

Subject: ls problem with matlab 2009a in ubuntu

From: David Zhang

Date: 28 Jun, 2011 04:09:04

Message: 1 of 7

I've installed matlab 2009a on my ubuntu 10.04 box. Everything works great, except with the annoying problem where if I type the command "ls" to show the current directory, the results contains strange characters in addition to the file names. For example, in my home folder:
>> ls
bin Desktop Documents Downloads finance Music Pictures Public Templates Videos

Repeating the same thing by explicitly invoking the unix command "!ls" gives the same problem, which suggests there is some sort of communication problem between matlab and unix. Running the same matlab in terminal and I don't have this issue.

Some might say "why don't you just navigate using directory window?" Well, I could. However being with Linux for so long, moving through directories using command line is much faster and more comfortable for me. Although this is not a serious problem, it is annoying enough that it stains an otherwise beautiful installation of matlab on ubuntu.

Subject: ls problem with matlab 2009a in ubuntu

From: Nasser M. Abbasi

Date: 28 Jun, 2011 04:36:06

Message: 2 of 7

On 6/27/2011 9:09 PM, David Zhang wrote:
> I've installed matlab 2009a on my ubuntu 10.04 box. Everything works great, except with the annoying problem
> where if I type the command "ls" to show the current directory,

I can't help you with your problem. Just wanted to comment that
Linux has always been looked at as a second class citizen by
major companies, and its support always comes after windows
and the mac.

I Can't really blame the companies much. They go after where
the market share is, this is where the money is, which is
on winodws and mac.

--Nasser

Subject: ls problem with matlab 2009a in ubuntu

From: Grzegorz Knor

Date: 28 Jun, 2011 06:02:04

Message: 3 of 7

Does DIR command generate the same "error"?
I work on:
MATLAB Version 7.10.0.499 (R2010a)
Operating System: Linux 2.6.38-8-generic-pae

and everything (ls and dir) work fine.

Grzegorz

Subject: ls problem with matlab 2009a in ubuntu

From: Doug Schwarz

Date: 28 Jun, 2011 11:37:07

Message: 4 of 7

In article <iubk50$g2i$1@newscl01ah.mathworks.com>,
 "David Zhang" <solarbikedz@gmail.com> wrote:

> I've installed matlab 2009a on my ubuntu 10.04 box. Everything works great,
> except with the annoying problem where if I type the command "ls" to show the
> current directory, the results contains strange characters in addition to the
> file names. For example, in my home folder:
> >> ls
> bin Desktop Documents 
> [01;34mDownloads finance Music 
> [01;34mPictures Public Templates 
> [01;34mVideos
> 
> Repeating the same thing by explicitly invoking the unix command "!ls" gives
> the same problem, which suggests there is some sort of communication problem
> between matlab and unix. Running the same matlab in terminal and I don't
> have this issue.
>
> Some might say "why don't you just navigate using directory window?" Well, I
> could. However being with Linux for so long, moving through directories
> using command line is much faster and more comfortable for me. Although this
> is not a serious problem, it is annoying enough that it stains an otherwise
> beautiful installation of matlab on ubuntu.

Those are ANSI escape sequences. <escape>[0m turns all attributes off,
<escape>[01;34m makes the text bold with a blue background. You must
have ls configured to use color by default, perhaps with the environment
variable CLICOLOR. See the man page for ls for more info.

--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.

Subject: ls problem with matlab 2009a in ubuntu

From: Doug Schwarz

Date: 28 Jun, 2011 13:24:08

Message: 5 of 7

On 6/28/2011 7:37 AM, Doug Schwarz wrote:
> In article<iubk50$g2i$1@newscl01ah.mathworks.com>,
> "David Zhang"<solarbikedz@gmail.com> wrote:
>
>> I've installed matlab 2009a on my ubuntu 10.04 box. Everything works great,
>> except with the annoying problem where if I type the command "ls" to show the
>> current directory, the results contains strange characters in addition to the
>> file names. For example, in my home folder:
>> >> ls
>> bin Desktop Documents 
>> [01;34mDownloads finance Music 
>> [01;34mPictures Public Templates 
>> [01;34mVideos
>> 
>> Repeating the same thing by explicitly invoking the unix command "!ls" gives
>> the same problem, which suggests there is some sort of communication problem
>> between matlab and unix. Running the same matlab in terminal and I don't
>> have this issue.
>>
>> Some might say "why don't you just navigate using directory window?" Well, I
>> could. However being with Linux for so long, moving through directories
>> using command line is much faster and more comfortable for me. Although this
>> is not a serious problem, it is annoying enough that it stains an otherwise
>> beautiful installation of matlab on ubuntu.
>
> Those are ANSI escape sequences.<escape>[0m turns all attributes off,
> <escape>[01;34m makes the text bold with a blue background. You must
> have ls configured to use color by default, perhaps with the environment
> variable CLICOLOR. See the man page for ls for more info.

On Ubuntu, it looks like the appropriate environment variable is
LS_COLORS. See also the man page for dircolors.


--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.

Subject: ls problem with matlab 2009a in ubuntu

From: Steven_Lord

Date: 28 Jun, 2011 14:02:32

Message: 6 of 7



"David Zhang" <solarbikedz@gmail.com> wrote in message
news:iubk50$g2i$1@newscl01ah.mathworks.com...
> I've installed matlab 2009a on my ubuntu 10.04 box. Everything works
> great, except with the annoying problem where if I type the command "ls"
> to show the current directory, the results contains strange characters in
> addition to the file names. For example, in my home folder:
>>> ls
> bin Desktop Documents
> Downloads finance Music
> Pictures Public Templates
> Videos
> 
> Repeating the same thing by explicitly invoking the unix command "!ls"
> gives the same problem, which suggests there is some sort of communication
> problem between matlab and unix. Running the same matlab in terminal and
> I don't have this issue.
>
> Some might say "why don't you just navigate using directory window?"
> Well, I could. However being with Linux for so long, moving through
> directories using command line is much faster and more comfortable for me.
> Although this is not a serious problem, it is annoying enough that it
> stains an otherwise beautiful installation of matlab on ubuntu.

At one point, I thought there was an item on the support website for this,
but I can't find it right now. I did however find an older CSSM posting
about this issue that offered several suggestions:

http://www.mathworks.com/matlabcentral/newsreader/view_thread/156139

You should take a look at the reference pages for Ubuntu's LS and DIRCOLORS
commands.

http://manpages.ubuntu.com/manpages/hardy/man1/ls.1.html

http://manpages.ubuntu.com/manpages/intrepid/man1/dircolors.1.html

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: ls problem with matlab 2009a in ubuntu

From: David Zhang

Date: 28 Jun, 2011 14:44:06

Message: 7 of 7

"Steven_Lord" <slord@mathworks.com> wrote in message <iucmto$fui$1@newscl01ah.mathworks.com>...
>
>
> "David Zhang" <solarbikedz@gmail.com> wrote in message
> news:iubk50$g2i$1@newscl01ah.mathworks.com...
> > I've installed matlab 2009a on my ubuntu 10.04 box. Everything works
> > great, except with the annoying problem where if I type the command "ls"
> > to show the current directory, the results contains strange characters in
> > addition to the file names. For example, in my home folder:
> >>> ls
> > bin Desktop Documents
> > Downloads finance Music
> > Pictures Public Templates
> > Videos
> > 
> > Repeating the same thing by explicitly invoking the unix command "!ls"
> > gives the same problem, which suggests there is some sort of communication
> > problem between matlab and unix. Running the same matlab in terminal and
> > I don't have this issue.
> >
> > Some might say "why don't you just navigate using directory window?"
> > Well, I could. However being with Linux for so long, moving through
> > directories using command line is much faster and more comfortable for me.
> > Although this is not a serious problem, it is annoying enough that it
> > stains an otherwise beautiful installation of matlab on ubuntu.
>
> At one point, I thought there was an item on the support website for this,
> but I can't find it right now. I did however find an older CSSM posting
> about this issue that offered several suggestions:
>
> http://www.mathworks.com/matlabcentral/newsreader/view_thread/156139
>
> You should take a look at the reference pages for Ubuntu's LS and DIRCOLORS
> commands.
>
> http://manpages.ubuntu.com/manpages/hardy/man1/ls.1.html
>
> http://manpages.ubuntu.com/manpages/intrepid/man1/dircolors.1.html
>
> --
> Steve Lord
> slord@mathworks.com
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com

Yes that is the problem. Now, is there a way to do it so that I don't loose the color in terminal?

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us