Hallo.
Ich beobachte manchmal mit tail -f /var/log/* alle log Dateien.
Leider schließt es aus die gz Dateien immer ein, so das ich erstmal etwas Binäres sehe.
Kann man in irgendeiner form evtl. auschließen?
Besten Gruß
tail auf /var/log ohne gz
Re: tail auf /var/log ohne gz
Ich weiss nicht, ob es in der Bash geht, aber afair in der zsh muesste gehen.
Sitze aber gerade an Windows XP und kann es nicht probieren
.
Code: Alles auswählen
tail-f *.^gz
Sitze aber gerade an Windows XP und kann es nicht probieren
![Smile :-)](./images/smilies/icon_smile.gif)
-
- Beiträge: 105
- Registriert: 14.01.2012 06:46:09
Re: tail auf /var/log ohne gz
Das muss in eckige Klammern, also:
Code: Alles auswählen
tail -f /var/log/*.[^gz]
Re: tail auf /var/log ohne gz
Hier haben beide Varianten nicht so überzeugt, stattdessen geht das:Könnte aber etwa mit find eleganter gehen, da muss man nicht den absoluten Pfad dranflanschen, ls kann das nicht (oder doch?!).
Gruß Cae
Code: Alles auswählen
$ ls -I '*.gz' /var/log/ -1 | sed 's#^#/var/log/#' | xargs tail -f
Gruß Cae
If universal surveillance were the answer, lots of us would have moved to the former East Germany. If surveillance cameras were the answer, camera-happy London, with something like 500,000 of them at a cost of $700 million, would be the safest city on the planet.
—Bruce Schneier
Re: tail auf /var/log ohne gz
Vielleicht so:
Naja. Stark verbesserungsfähig. Wahrscheinlich macht es mehr Sinn nur Logfiles zu betrachten:
Mag im übrigen sein, dass nur ich diese Sonderzeichen habe, so dass "strings" nicht benötigt wird.
Code: Alles auswählen
find /var/log -type f ! -iregex '.*gz$' |xargs tail -f |strings
Code: Alles auswählen
find /var/log -type f -iregex '.*log$' |xargs tail -f |strings
find /var/log -type f -name "*log" |xargs tail -f |strings
Re: tail auf /var/log ohne gz
Was ist mit /var/log/mail.warn oder .err? Der Rest besteht zugegebenermaßen haupsächlich aus .log.uname hat geschrieben:Wahrscheinlich macht es mehr Sinn nur Logfiles zu betrachten
Gruß Cae
If universal surveillance were the answer, lots of us would have moved to the former East Germany. If surveillance cameras were the answer, camera-happy London, with something like 500,000 of them at a cost of $700 million, would be the safest city on the planet.
—Bruce Schneier
Re: tail auf /var/log ohne gz
Naja. Dann muss man eben den iregex-Ausdruck entsprechend erweitern.