?
Solved

File size is different in vi as opposed to when it is shown in the directory

Posted on 2007-03-22
2
Medium Priority
?
167 Views
Last Modified: 2013-12-16
I have a Linux ascii text file. The size shows 234642925 when I do: ls -l. However, when I do a vi on it, at the bottom the size shows as 234642973C where C is the number of characters. Can you anybody tell me why?
0
Comment
Question by:soccerplayer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Accepted Solution

by:
ssvl earned 2000 total points
ID: 18791786
by default, vi enforces the upper limit of 1,048,560 lines. If you have a file that has more lines than this, then you need to change this default value by starting vi using the -yNumber option. Following is an excerpt from the man page for -yNumber on Libra:
"-yNumber Overrides the maximum line setting of 1,048,560 with any value greater than 1024. You should request twice the number of lines that you require because the vi editor uses the extra lines for buffer manipulation."
0
 
LVL 2

Expert Comment

by:jaredcall
ID: 18812355
it may be that ls shows the file size on disk (including partially allocated blocks).  vi wouldn't care about that, just character count.
0

Featured Post

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month13 days, 14 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question