The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > Linux
Google UNIX.COM


Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Deleting lines inside a file without opening the file toms Shell Programming and Scripting 3 09-24-2007 04:58 AM
prob with spaces in reading a file Amardeep Shell Programming and Scripting 2 05-23-2006 08:54 AM
Opening a file during FTP ceaker High Level Programming 1 03-31-2006 11:40 PM
opening a file hiei UNIX for Dummies Questions & Answers 4 03-31-2004 09:24 PM
Dos window, long file names prob kymberm Windows & DOS: Issues & Discussions 4 10-10-2002 10:18 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 07-26-2008
Registered User
 

Join Date: May 2008
Posts: 51
File opening prob. plz assist guys

Hi friends, this problem is pretty similar to the thread that i have generated earlier.
If the TXT file that i have opened using "cat" is huge then my putty can only show me last few lines. Similarly if i use "more" command to open a huge TXT file then it asks to press any key to scroll up the text.
Is there any way out by which instead of scrolling up whole file (like which happens when we use "cat") it will show maximum lines right from starting of file and den will ask to press any key to scroll next maximum possible contaits?
I hope i have put my problem succesfully before u.
Please assist guys.
Thanx in advance
Anushree
Reply With Quote
Forum Sponsor
  #2  
Old 07-26-2008
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,610
Code:
it will show maximum lines right from starting of file
I don't understand this. What do you mean by maximum lines right from the beginning ?

Could you please elaborate based on line numbers in the file ?
Reply With Quote
  #3  
Old 07-26-2008
Yogesh Sawant's Avatar
Part Time Moderator and Full Time Dad
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 790
check if less command is what you want
Reply With Quote
  #4  
Old 07-26-2008
Registered User
 

Join Date: May 2008
Posts: 51
if i cat a file i can read last 241 lines only... i cant see complete file in one go... for e.g. i hv cat a huge txt file hving 5000 lines then i can see last 241 lines only. What can i do to see entire file? I m using linix / unix thro' putty
Reply With Quote
  #5  
Old 07-26-2008
Moderator
 

Join Date: Feb 2007
Posts: 2,200
Have you tried the less command as Yogesh Sawant mentioned?
There are a lot of options to scroll within a file with less. You can search for patterns in your file with /pattern.
To go to line 50 you can type 50g, with 100 you can scroll 100 lines down etc.

Read the manpage of less for other options.

Regards
Reply With Quote
  #6  
Old 07-28-2008
Registered User
 

Join Date: May 2008
Posts: 51
Dear Franklin, I dont kno how to use less command. Can u please assist me?
when i use less <file name> i am getting following error
ksh: less: not found
Reply With Quote
  #7  
Old 07-28-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,650
less is a replacement for more. If it's not installed, you will need to install it. It's open source, so you can download and compile it yourself; but if you are not familiar with basic Unix developer tools, it's probably easier to get it from your vendor. How and what exactly depends on your platform. For RPM-based Linux, try rpmsearch. For Debian and Ubuntu, apt-get install less. For big-iron "real" Unix, contact your local system administrator. You most likely need root access to install packages system-wide, but there may also be an option to install for your private use.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
cat, pager, view

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:48 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0