Назад | Перейти на главную страницу

Ошибка grep или ограничение на текстовый файл объемом 1,2 ГБ?

Команда grep для большого файла, за которой следует хвост, дает неверный результат, см. доказательство ниже. Размер файла 1,2 ГБ, но grep должен обрабатывать его как поток, в чем может быть проблема?

root@condor1796 /home/glassfish/apache-tomcat-8.5.5/logs # tail -n 20000 catalina.out | grep "Deploy"
10-Jan-2017 02:26:48.011 INFO [www.numbeo.com-startStop-2] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /home/glassfish/apache-tomcat-8.5.5/appBaseLivingCost/ROOT.war
10-Jan-2017 02:26:49.850 INFO [www.numbeo.com-startStop-2] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /home/glassfish/apache-tomcat-8.5.5/appBaseLivingCost/ROOT.war has finished in 1,839 ms
10-Jan-2017 02:28:56.096 INFO [www.numbeo.com-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /home/glassfish/apache-tomcat-8.5.5/appBaseLivingCost/ROOT.war
10-Jan-2017 02:28:56.718 INFO [www.numbeo.com-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /home/glassfish/apache-tomcat-8.5.5/appBaseLivingCost/ROOT.war has finished in 622 ms
10-Jan-2017 02:28:56.719 INFO [numbeo.com-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /home/glassfish/apache-tomcat-8.5.5/appBaseNonWwwNumbeo/ROOT.war
10-Jan-2017 02:28:56.823 INFO [numbeo.com-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /home/glassfish/apache-tomcat-8.5.5/appBaseNonWwwNumbeo/ROOT.war has finished in 104 ms
10-Jan-2017 02:28:56.868 INFO [intl.numbeo.com-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /home/glassfish/apache-tomcat-8.5.5/appBaseAcmeOnly/ROOT.war
10-Jan-2017 02:28:56.909 INFO [intl.numbeo.com-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /home/glassfish/apache-tomcat-8.5.5/appBaseAcmeOnly/ROOT.war has finished in 41 ms
10-Jan-2017 02:28:56.910 INFO [numbeo.com-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /home/glassfish/apache-tomcat-8.5.5/appBaseNonWwwNumbeo/ROOT.war
10-Jan-2017 02:28:56.979 INFO [numbeo.com-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /home/glassfish/apache-tomcat-8.5.5/appBaseNonWwwNumbeo/ROOT.war has finished in 68 ms


root@condor1796 /home/glassfish/apache-tomcat-8.5.5/logs # grep "Deploy" ~glassfish/apache-tomcat-8.5.5/logs/catalina.out | tail -n 6
21-Dec-2016 04:40:24.964 INFO [numbeo.com-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /home/glassfish/apache-tomcat-8.5.5/appBaseNonWwwNumbeo/ROOT.war has finished in 110 ms
21-Dec-2016 04:40:25.001 INFO [intl.numbeo.com-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /home/glassfish/apache-tomcat-8.5.5/appBaseAcmeOnly/ROOT.war
21-Dec-2016 04:40:25.096 INFO [intl.numbeo.com-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /home/glassfish/apache-tomcat-8.5.5/appBaseAcmeOnly/ROOT.war has finished in 95 ms
21-Dec-2016 04:40:25.098 INFO [numbeo.com-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /home/glassfish/apache-tomcat-8.5.5/appBaseNonWwwNumbeo/ROOT.war
21-Dec-2016 04:40:25.210 INFO [numbeo.com-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /home/glassfish/apache-tomcat-8.5.5/appBaseNonWwwNumbeo/ROOT.war has finished in 112 ms
Binary file /home/glassfish/apache-tomcat-8.5.5/logs/catalina.out matches
root@condor1796 /home/glassfish/apache-tomcat-8.5.5/logs #