FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 08-01-2012, 01:00 AM
Paul Allen Newell
 
Default question regarding ls w/ colors and capturing to file

On 7/31/2012 4:35 AM, Ed Greshko wrote:

On 07/31/2012 07:12 PM, Mikkel L. Ellertson wrote:

Wouldn't -R work better then -r?

Yes, it would be better.



Ed and Mikkel:

+++
script -c "ls -FR --color" outfile; less -R outfile
+++

works great. Its a bit of a pain to not be able to use an editor to scan
the file, but I am happy to be able to get "page breaks" with the color
as that's better than setting a window scroll memory to 10K lines (and
it seems the script command gives me that anyway as everything goes to
the screen first.


Many thanks,
Paul


--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 
Old 08-01-2012, 01:00 AM
Paul Allen Newell
 
Default question regarding ls w/ colors and capturing to file

On 7/31/2012 12:22 PM, Dave Mitchell wrote:

On Tue, Jul 31, 2012 at 10:10:22AM -0700, Joe Zeff wrote:

On 07/31/2012 12:45 AM, Ed Greshko wrote:

At the moment, I can't think of what editor would retain the colors. :-(

If it's too long, run it through either more or less.

I think the complete command that would satisfy the OP is:

ls -C --color=always | less -R



Dave:

This also works very well

Many thanks,
Paul
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 
Old 08-01-2012, 01:24 AM
"Mikkel L. Ellertson"
 
Default question regarding ls w/ colors and capturing to file

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/31/2012 08:00 PM, Paul Allen Newell wrote:
> On 7/31/2012 4:35 AM, Ed Greshko wrote:
>> On 07/31/2012 07:12 PM, Mikkel L. Ellertson wrote:
>>> Wouldn't -R work better then -r?
>> Yes, it would be better.
>>
>
> Ed and Mikkel:
>
> +++
> script -c "ls -FR --color" outfile; less -R outfile
> +++
>
> works great. Its a bit of a pain to not be able to use an editor
to scan the file, but I am happy to be able to get "page breaks"
with the color as that's better than setting a window scroll memory
to 10K lines (and it seems the script command gives me that anyway
as everything goes to the screen first.
>
> Many thanks,
> Paul
>
>
Paul,
You may want to look at the search capabilities built into less.
(man less). Unless you need to modify the file, less should let you
do what you want.
Also, you can use ls -FR --color | less -R to get rid of the output
to the screen buffer.

Have fun.
Mikkel
- --
Do not meddle in the affairs of dragons, for thou art crunchy and
taste good with Ketchup!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlAYhUkACgkQqbQrVW3JyMTXsACbBSH6/Obxw8PBkXY9mIY0swRj
3QkAn0pTRNV9l4j/FT4opQUzqUd+0Azb
=dtDM
-----END PGP SIGNATURE-----

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 
Old 08-01-2012, 01:38 AM
Paul Allen Newell
 
Default question regarding ls w/ colors and capturing to file

On 7/31/2012 6:24 PM, Mikkel L. Ellertson wrote:


Paul,
You may want to look at the search capabilities built into less.
(man less). Unless you need to modify the file, less should let you
do what you want.
Also, you can use ls -FR --color | less -R to get rid of the output
to the screen buffer.

Have fun.
Mikkel


Mikkel:

Yeah, I think I have underestimated what less can do ... I'll check the
man pages.


I want to believe that all I want the editor for is navigation, but I
know that occasionally I edit out items I don't care about so I have a
file left of "things to work on".


I pretty happy with the two options I got, it makes initial scan for
"problems" alot easier.


Thanks,
Paul

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 
Old 08-01-2012, 07:20 AM
David
 
Default question regarding ls w/ colors and capturing to file

On 01/08/2012, Mikkel L. Ellertson <mellertson@gmail.com> wrote:
>
> Also, you can use ls -FR --color | less -R to get rid of the output
> to the screen buffer.

The -F option of 'less' could be added:
ls -FR --color | less -FR

This activates 'less' only if necessary, when there is more data than
will fit on one screen.
This could then be made into a function, for convenience:

function myfuncname { ls -FR --color | less -FR ; }

After this is done once, just type myfuncname to run the whole thing
anywhere, anytime
(but only in that shell).
Function definitions like this usually go into .bashrc in your home
directory so that they are automatically defined in every shell you
start.

Also, be aware that the behaviour of less is customisable by setting
an environment variable named LESS. I have
export LESS="FMRSX#.2"
in .bash_profile in my home directory, so this activates -FR without
needing to specify it explicitly anywhere.
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 

Thread Tools




All times are GMT. The time now is 07:14 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org