Unix Technical Forum

less: display and quit if one screen

This is a discussion on less: display and quit if one screen within the Gentoo Linux Support forums, part of the Unix Operating Systems category; --> Hi all! There was this nifty thing that less would do on Suse, and I'm currently not able to ...


Go Back   Unix Technical Forum > Unix Operating Systems > Gentoo Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-21-2008, 10:28 AM
Anno v. Heimburg
 
Posts: n/a
Default less: display and quit if one screen

Hi all!

There was this nifty thing that less would do on Suse, and I'm currently not
able to reproduce on gentoo: Have less display the file and immediately
quit if fits on one screen, mimicking cat.

On gentoo, normally, less alyways takes up the entire screen, even if the
file would fit on one screen (so cat would have been sufficient to display
it). The less option --quit-if-one-screen comes close, but not close
enough: Less quits immediately if the file would have fit on one screen,
without diplaying it. How can I make less display-and-quit-if-one-screen?

Thanks,
Anno
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-21-2008, 10:28 AM
Bilko
 
Posts: n/a
Default Re: less: display and quit if one screen

Anno,

Try this:

less -FX <file name>


Anno v. Heimburg wrote:
> Hi all!
>
> There was this nifty thing that less would do on Suse, and I'm currently not
> able to reproduce on gentoo: Have less display the file and immediately
> quit if fits on one screen, mimicking cat.
>
> On gentoo, normally, less alyways takes up the entire screen, even if the
> file would fit on one screen (so cat would have been sufficient to display
> it). The less option --quit-if-one-screen comes close, but not close
> enough: Less quits immediately if the file would have fit on one screen,
> without diplaying it. How can I make less display-and-quit-if-one-screen?
>
> Thanks,
> Anno

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-21-2008, 10:29 AM
Anno v. Heimburg
 
Posts: n/a
Default Re: less: display and quit if one screen

> less -FX <file name>

Yup, that's close. It will add some blank lines at the beginning, but other
than that, it does what I wanted. Thanks a bunch.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:09 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com