免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1906 | 回复: 0
打印 上一主题 下一主题

[文本处理] sed 指定行输出 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2019-05-10 16:45 |只看该作者 |倒序浏览
不太会用sed命令,请各位大神帮忙要求从logrotate -d命令中,用sed只打印出以下内容:
rotating pattern: /var/log/cron
/var/log/maillog
/var/log/messages
/var/log/secure
/var/log/spooler
weekly (4 rotations)
empty log files are rotated, old logs are removed


logrotate -d输出:
reading config file /etc/logrotate.conf
including /etc/logrotate.d
reading config file cups
reading config info for /var/log/cups/*_log
reading config file dracut
reading config info for /var/log/dracut.log
reading config file httpd
reading config info for /var/log/httpd/*log
reading config file ppp
reading config info for /var/log/ppp/connect-errors
reading config file psacct
reading config info for /var/account/pacct
reading config file samba
reading config info for /var/log/samba/*
olddir is now /var/log/samba/old
reading config file sssd
reading config info for /var/log/sssd/*.log
reading config file subscription-manager
reading config info for /var/log/rhsm/*.log
reading config file syslog
reading config info for /var/log/cron
/var/log/maillog
/var/log/messages
/var/log/secure
/var/log/spooler


reading config file up2date
reading config info for /var/log/up2date
reading config file wpa_supplicant
reading config info for /var/log/wpa_supplicant.log
reading config file yum
reading config info for /var/log/yum.log
reading config info for /var/log/wtmp
reading config info for /var/log/btmp


Handling 14 logs


rotating pattern: /var/log/cups/*_log  weekly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/cups/error_log
  log does not need rotating


rotating pattern: /var/log/dracut.log  yearly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/dracut.log
  log does not need rotating


rotating pattern: /var/log/httpd/*log  weekly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/httpd/access_log
  log does not need rotating
considering log /var/log/httpd/error_log
  log does not need rotating
not running postrotate script, since no logs were rotated


rotating pattern: /var/log/ppp/connect-errors  after 1 days (5 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/ppp/connect-errors
  log /var/log/ppp/connect-errors does not exist -- skipping


rotating pattern: /var/account/pacct  after 1 days (31 rotations)
empty log files are not rotated, old logs are removed
considering log /var/account/pacct
  log does not need rotating
not running postrotate script, since no logs were rotated


rotating pattern: /var/log/samba/*  weekly (4 rotations)
olddir is /var/log/samba/old, empty log files are not rotated, old logs are removed
considering log /var/log/samba/log.127.0.0.1
  log does not need rotating
considering log /var/log/samba/log.192.168.220.1
  log does not need rotating
considering log /var/log/samba/log.192.168.220.129
  log does not need rotating
considering log /var/log/samba/log.myserver
  log does not need rotating
considering log /var/log/samba/log.nmbd
  log does not need rotating
considering log /var/log/samba/log.rhel65test
  log does not need rotating
considering log /var/log/samba/log.senttd01
  log does not need rotating
considering log /var/log/samba/log.smbd
  log does not need rotating


rotating pattern: /var/log/sssd/*.log  weekly (2 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/sssd/*.log
  log /var/log/sssd/*.log does not exist -- skipping
not running postrotate script, since no logs were rotated


rotating pattern: /var/log/rhsm/*.log  weekly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/rhsm/rhsmcertd.log
  log does not need rotating
considering log /var/log/rhsm/rhsm.log
  log does not need rotating


rotating pattern: /var/log/cron
/var/log/maillog
/var/log/messages
/var/log/secure
/var/log/spooler
weekly (4 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/cron
  log does not need rotating
considering log /var/log/maillog
  log does not need rotating
considering log /var/log/messages
  log does not need rotating
considering log /var/log/secure
  log does not need rotating
considering log /var/log/spooler
  log does not need rotating
not running postrotate script, since no logs were rotated


rotating pattern: /var/log/up2date  weekly (4 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/up2date
  log /var/log/up2date does not exist -- skipping


rotating pattern: /var/log/wpa_supplicant.log  30720 bytes (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/wpa_supplicant.log
  log does not need rotating


rotating pattern: /var/log/yum.log  yearly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/yum.log
  log does not need rotating


rotating pattern: /var/log/wtmp  monthly (1 rotations)
empty log files are rotated, only log files >= 1048576 bytes are rotated, old logs are removed
considering log /var/log/wtmp
  log does not need rotating


rotating pattern: /var/log/btmp  monthly (1 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/btmp
  log does not need rotating





您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP