[root@xxx httpd]# head -n 4 /var/log/httpd/*
==> /var/log/httpd/access_log <==
xxxx - - [06/Dec/2015:22:22:45 +0100] "GET / HTTP/1.1" 200 7 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.99 Safari/537.36 Vivaldi/1.0.303.52"
xxxx - - [06/Dec/2015:22:22:46 +0100] "GET /favicon.ico HTTP/1.1" 404 291 "http://195.154.165.63:8001/" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.99 Safari/537.36 Vivaldi/1.0.303.52"
==> /var/log/httpd/access_log-20151018 <==
xxxx - - [12/Oct/2015:14:05:42 +0200] "GET /git HTTP/1.1" 404 281 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0"
xxxx - - [12/Oct/2015:14:05:42 +0200] "GET /favicon.ico HTTP/1.1" 404 289 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0"
xxxx - - [12/Oct/2015:14:05:43 +0200] "GET /favicon.ico HTTP/1.1" 404 289 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0"
xxxx - - [12/Oct/2015:14:06:24 +0200] "GET /git HTTP/1.1" 502 465 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0"
==> /var/log/httpd/access_log-20151115 <==
xxxx - - [14/Nov/2015:18:56:04 +0100] "GET / HTTP/1.1" 200 7 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0"
xxxx - - [14/Nov/2015:18:56:05 +0100] "GET /favicon.ico HTTP/1.1" 404 291 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0"
xxxx - - [14/Nov/2015:18:56:05 +0100] "GET /favicon.ico HTTP/1.1" 404 291 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0"
xxxx - - [14/Nov/2015:18:58:28 +0100] "GET /phpmyadmin HTTP/1.1" 403 294 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0"
É uma amostra do meu diretório httpd com o comando head -n 4 /var/log/httpd/*
para as primeiras 4 linhas. Substitua head -n 4
por head -n 1
pelas primeiras linhas.
E você pode substituir o diretório /var/log/httpd/*
pelo seu diretório, por exemplo, /my/directory/*
, mas não se esqueça do caractere curinga no final ( *
).
Este curinga permite dizer que queremos todos os arquivos (não ocultos) no diretório.