免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: yonghuzcy
打印 上一主题 下一主题

sed或awk对于一行超过2048字节的行操作都不启作用! [复制链接]

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
11 [报告]
发表于 2006-08-22 15:36 |只看该作者
原帖由 yonghuzcy 于 2006-8-21 16:02 发表
烈火兄,怎么fmt,告之,谢谢:)

man fmt

论坛徽章:
0
12 [报告]
发表于 2006-08-22 16:01 |只看该作者
看来确实是和系统有关系阿!

论坛徽章:
0
13 [报告]
发表于 2006-08-22 16:07 |只看该作者
原帖由 Suchangyu 于 2006-8-22 15:32 发表

请 4Aiur 解释一下你给的东西吧!


我是用的机器做的测试与scode做对比

原帖由 scode 于 2006-8-21 15:37 发表
做了个测试,apache日志文件1.6G,一共1600多万行。
我用awk '{print $1}' access_log 发现出现错误
[code]awk: input record `61.132.138.150 - - [...' too long
input record number 710342, file access_l ...

论坛徽章:
0
14 [报告]
发表于 2006-08-22 17:13 |只看该作者
[ Next Article | Previous Article | Book Contents | Library Home | Legal |
                                   Search ]
-------------------------------------------------------------------------------
                         Commands Reference, Volume 2
-------------------------------------------------------------------------------

fmt Command

Purpose

Formats mail messages prior to sending.

Syntax

/usr/bin/fmt [ -Width ] [ File ... ]

Description

The fmt command starts a text formatter that reads the concatenation of input
Files (or standard input if no Files are specified), then produces on standard
output a version of the input with the line lengths set to the value of -Width.
If no value is specified with the -Width flag, the default value of 72
characters is used. The spacing at the beginning of the input lines is preserved
in the output, as are blank lines and spacing between words.

The fmt command is generally used to format mail messages to improve their
appearance before they are sent. However, the fmt command may also be useful for
simple formatting tasks. For example, within visual mode of a text editing
program such as the vi editor, the command !}fmt formats a paragraph so that all
lines are set to the value specified with the -Width flag. If no value is
specified with the -Width flag, the default value of 72 characters is used.
Standard text editing programs are more appropriate than fmt for complex
formatting operations.

    Note: Do not use the fmt command if the message contains embedded messages
    or preformatted information from other files. This command formats the
    heading information in embedded messages and may change the format of
    preformatted information.

Flags

File Specifies the name of the file to be formatted.

-Width Specifies the line length. The default value for Width is 72 characters.

Examples

  1. To format a message you have created with the mail editor, enter:
     ~| fmt

     The ~| is entered at the left margin of the message. After you issue the ~|
     fmt command, the message is formatted. The word (continue) is displayed to
     indicate that you can enter more information or send the message.
  2. To format a file and display the output on your screen, enter:
     fmt file1

     In this example, the file file1 is formatted and displayed on your screen.

Files

/usr/bin/fmt Contains the fmt command.

Related Information

The mail command, nroff command, vi command.

Editor Overview in AIX Version 4.3 INed Editor User's Guide.

Mail Overview in AIX Version 4.3 System User's Guide: Communications and
Networks.
-------------------------------------------------------------------------------
  [ Next Article | Previous Article | Book Contents | Library Home | Legal |
                                   Search ]

论坛徽章:
0
15 [报告]
发表于 2006-08-25 16:13 |只看该作者
原帖由 4Aiur 于 2006-8-22 16:07 发表


我是用的机器做的测试与scode做对比



我不懂 awk,tail 和 test ,所以才会问这样的问题。

刚才查了一下 man ,知道“ tail -1 ip ”是打印 ip的最后一行,28365714是你测试得到的行数。

可是,下段命令没有看懂:

  1. test 5.2G
复制代码

再麻烦指点我一下,谢谢!

论坛徽章:
0
16 [报告]
发表于 2006-08-25 16:37 |只看该作者
原帖由 Suchangyu 于 2006-8-25 16:13 发表


我不懂 awk,tail 和 test ,所以才会问这样的问题。

刚才查了一下 man ,知道“ tail -1 ip ”是打印 ip的最后一行,28365714是你测试得到的行数。

可是,下段命令没有看懂:
[code]
test 5.2G
[/ ...


我测试文件(test)的大小是5.2G的
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP