每日一命令(12)head (output the first part of files)

head (output the first part of files)

man head 命令查看

head -[ncqv] file
-n 显示的行数 默认是前10行
-c 每次输出的字节数
-v 输出显示文件名字
-q 输出一直不显示文件名字

head -n 1 test.txt

root@nginx02  ~
# head -n 1 test.txt 
dfasfd:

root@nginx02  ~
# head  test.txt 
dfasfd:
Nginx may terminate a request early with (at least):

400 (Bad Request)
405 (Not Allowed)
408 (Request Timeout)
414 (Request URI Too Large)
494 (Request Headers Too Large)
499 (Client Closed Request)
500 (Internal Server Error)

root@nginx02  ~
# head -2 test.txt 
dfasfd:
Nginx may terminate a request early with (at least):

head -v test.txt 输出显示文件名字

root@nginx02  ~
# head -v test.txt 
==> test.txt <==
dfasfd:
Nginx may terminate a request early with (at least):

400 (Bad Request)
405 (Not Allowed)
408 (Request Timeout)
414 (Request URI Too Large)
494 (Request Headers Too Large)
499 (Client Closed Request)
500 (Internal Server Error)

head -c 1 test.txt 每次显示多少字节数

root@nginx02  ~
# head -c 1 test.txt 
d
root@nginx02  ~
# head -c 2 test.txt 
df
root@nginx02  ~
# head -c 2k test.txt 
dfasfd:
Nginx may terminate a request early with (at least):

400 (Bad Request)
405 (Not Allowed)
408 (Request Timeout)
414 (Request URI Too Large)
494 (Request Headers Too Large)
499 (Client Closed Request)
500 (Internal Server Error)
501 (Not Implemented)
This means that phases that normally run are skipped, such as the rewrite or access phase. This also means that later phases that are run regardless, e.g. log_by_lua, will not have access to information that is normally set in those phases.

Back to TOC

TODO
cosocket: implement LuaSocket's unconnected UDP API.
port this module to the "datagram" subsystem of NGINX for implementing general UDP servers instead of HTTP servers in Lua. For example,
 datagram {
     server {
         listen 1953;
         handler_by_lua '
             -- custom Lua code implementing the special UDP server...
         ';
     }
 }
shm: implement a "shared queue API" to complement the existing shared dict API.
cosocket: add support in the context of init_by_lua*.
cosocket: implement the bind() method for stream-typed cosockets.
cosocket: pool-based backend concurrency level control: implement automatic connect queueing when the backend concurrency exceeds its connection pool limit.
cosocket: review and merge aviramc's patch for adding the bsdrecv method.
add new API function ngx.resp.add_header to emulate the standard add_header config directive.
review and apply Jader H. Silva's patch for ngx.re.split().
review and apply vadim-pavlov's patch for ngx.location.capture's extra_headers option
use ngx_hash_t to optimize the built-in header look-up process for ngx.req.set_header, ngx.header.HEADER, and etc.
add configure options for different strategies of handling the cosocket connection exceeding in the pools.
add directives to run Lua codes when nginx stops.
add ignore_resp_headers, ignore_resp_body, and ignore_resp options to ngx.location.capture and ngx.location.capture_multi methods, to allow micro performance tuning on the user side.
add automatic Lua code time slicing support by y
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值