问题描述
当我使用vi分析日志文件时,有时会遇到以下错误:行过长".我可以使用more
观看文件,但这不是我想要的.
When I use vi to analyze log files, it sometimes is stuck with the error: 'Line too long'. I can watch the file using more
, but that's not what I want.
命令视图将导致相同的结果,并且未安装less
.
The command view leads to the same result and less
is not installed.
系统为HP-UX v B.11.31 U ia64
System is HP-UX v B.11.31 U ia64
- 此错误是什么意思? vi确实对每行允许多少个字符有限制吗?
- 有没有解决方法,无论如何如何打开文件并在vi中显示?
推荐答案
(1)显然是这样的:-)
(1) Apparently so :-)
我以前从未遇到过vim
的限制,但可能是HPUX附带的vi
不是vim
.
I've never run into a limitation in vim
before but it may be that the vi
shipping with HPUX is not vim
.
(2)您对使用vi
的日志文件进行哪种分析?
(2) What sort of analysis are you doing on log files with vi
?
这是一种任务,非常适合按sed
,awk
和Perl
之类的文本处理工具,以增强功能.
This is the sort of task perfectly suited to text processing tools like sed
, awk
and Perl
, in order of increasing awesomeness.
如果您还没有,请考虑使用vim
.在文档的vi_diff
部分(vi
和vim
之间的差异):
You may want to consider grabbing vim
if you don't have it already. From the vi_diff
part of the documentation (differences between vi
and vim
):
最大行长:在具有16位整数(Amiga和MS-DOS实模式)的计算机上:32767,否则为2147483647个字符.较长的行被分割.
Maximum line length: On machines with 16-bit ints (Amiga and MS-DOS real mode): 32767, otherwise 2147483647 characters. Longer lines are split.
最大行数:2147483647行.
Maximum number of lines: 2147483647 lines.
最大文件大小:长整数为32位时,为2147483647字节(2 GB). 64位长的更多内容.还受交换文件可用磁盘空间的限制.
Maximum file size: 2147483647 bytes (2 Gbyte) when a long integer is 32 bits. Much more for 64 bit longs. Also limited by available disk space for the swap-file.
这篇关于vi:线太长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!