LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 12-13-2005, 05:39 PM   #1
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 528

Rep: Reputation: 78
ls output problem


Hi there,

I have a little problem with the command "ls" when i redirect the output to a file
to redirect the output of ls in a file i do
$ls > destinationfile.txt

if i do a "cat" on the destinationfile.txt the file is printed on the screen correctly, but when i edit it with VI (for exemple) i have some strange characteres in the file like "^[[00m" at the begining and at the end of each line does anyone know why and how to redirect the out put of ls in a file with out these characteres?

Thanks in advance.

PS: sorry for this post but if i ask you that is because when i want to use the contenant of the destinationfile.txt in a script that giving me hard time.

Last edited by angel115; 12-13-2005 at 05:43 PM.
 
Old 12-13-2005, 06:21 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
turn of the colourisation of ls' output ...


ls --color=none



Cheers,
Tink

Last edited by Tinkster; 12-13-2005 at 06:31 PM. Reason: Accidentally used American spelling where it wasn't part of a command :D
 
Old 12-14-2005, 01:49 PM   #3
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 528

Original Poster
Rep: Reputation: 78
Thumbs up

Correct , it's just work fine now.

Thank you so much.
 
Old 12-15-2005, 12:35 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
Interestingly enough, I've got colour on, and have no probs with ls>t.t, then vi...
Maybe because I've got vi aliased to vim??
 
Old 12-15-2005, 02:23 AM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
I have colourisation turned off by default, but in this case did
an ls *with* it, and this is what I see in vim when I load the
resulting redirected output...

Code:
^[[00m^[[00m#allexes.txt#^[[00m
^[[00m#bench.txt#^[[00m
^[[00m#derange.date#^[[00m
^[[00m#gobble.pl#^[[00m
^[[00m#redhat.txt#^[[00m
^[[00m#test_autofill.txt#^[[00m
^[[00m#testing.txt#^[[00m

Cheers,
Tink
 
Old 12-15-2005, 07:40 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
Guess you're just unlucky eh?
FYI I'm on Fedora Core release 3 (Heidelberg), 2.6.10-1.770_FC3smp , vim 6.3.54 in case that helps.
I could manage without colour (old time programmer), but it's handy to have.
Don't think there's been any funny customisation to make it work.
HTH
 
Old 12-15-2005, 09:08 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Oh, don't get me wrong, vim DOES do colours when I do coding,
just can't make sense of the colourised ls output ;)


Cheers,
Tink
 
Old 12-15-2005, 10:58 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
Sorry, I obviously wasn't clear... what i meant was I have colour at the cmd line eg inc 'ls' and inside vim, and I can vim a file created by 'coloured' ls no prob...
 
  


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
Let's try Output Device Problem in 10.1 matthewa Slackware 3 08-17-2005 03:37 AM
Knoppix 5.1 output problem AciDusT Linux - Newbie 5 03-01-2005 09:58 AM
the sound gives output when using mic but no output when run a music file medo Debian 0 04-19-2004 08:17 PM
Problem with running c++ output abhisec Programming 1 03-13-2004 09:23 AM
Output problem....please help kesta73 Programming 2 09-23-2003 11:50 PM


All times are GMT -5. The time now is 06:53 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration