Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have a file that is close to a 2Gig file-- need to perform a vi on it so I can manually edit it .
getting an error when I do a vi on the file
tmp file too large--
how can I open a file so I can see what I need to change-- sed will not work for what I need to do.
thanks

How about using 'split' to split the file into pieces, edit what is necessary and then use 'join' or 'cat' to put the pieces back together.

If you have a filesystem that has sufficient room to open a 2 gig file, then do the following:
vi
From the colon prompt, type:
:set directory=/bighonkingfilesystem
To see which directory is currently set in vi, type:
:set directory
To see everything, type:
:set all
:r <bigfile>
Otherwise, you'll have to figure out how to split it like Don has suggested.
By default, the vi editor uses /var/tmp, which on most unix installations is significantly smaller than 2 gig. I've never tried to open a 2 gig file with vi so even if your temp directory is big enough, perhaps vi will still fail (although I would assume you will get a different error).

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |