![](/img/trans.png)
[英]Why is '$_' the same as $ARGV in a Perl one-liner?
[英]unix or perl one liner for tailing more than one file at the same time
有人可以幫我提出一個快速的unix或perl一個襯墊同時尾部Xn的日志嗎? 我只需要在stdout上快速查看2個或更多日志,在屏幕上查看足夠的行。
我正在使用tail -30 filename_1.out
,但必須向上箭頭並更改1-> 2-> 3。 但是如果文件名是filename_1.out
, filename_2.out
, filename_3.out
,我真的想做的就是一次性傳遞幾個尾部。
tail
可以同時給出很多文件; 嘗試
tail -30 filename_[123].out
如果
tail -30 filename_*.out
不能用於特定版本的用戶工具(?)然后你總是可以這樣做:
(for a in filename*.out; do tail -f "$a"& done) | tail -f
例如跟隨尾巴
如果你的操作系統支持它使用multitail - 這正是你想要的。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.