~$: cat log/access.log | sed 's/ .*//' | sort -u > sorted-ips.tmp
Create a CVS branch (quick note)
Tag with the root tag:
~$: cvs -d /home/cvsroot/ rtag -F Root_CustomTag ModuleName
Create the Branch, starting at the created root tag:
~$: cvs -d /home/cvsroot/ rtag -F -b -B CustomTag ModuleName
Resuming execution of a suspended console process in the background
~$: ./start_a_testscript
Script is running fine in the foreground.
Press Strg+Z
~$: bg
bg resumes the execution of the suspended (Strg+Z) process without bringing it to the foreground.
fg is the complementary command and resumes the execution of the suspended (Strg+Z) process bringing it to the foreground.
Realtime logfile/traffic analyses (apache webserver)
Live „top 10“ useragents
~$: cat access.log | awk -F '"' '{print $6}' | sort | uniq -c | sort -nr | head
„Top 10“ useragents certain date and hour (grep pattern may differ)
~$: grep '12/Sep/2011:15' access.log | awk -F '"' '{print $6}' | sort | uniq -c | sort -nr | head
„Top 20“ referrers from the last 5000 hits
~$: tail -5000 access.log | awk '{print $11}' | tr -d '"' | sort | uniq -c | sort -rn | head -20
~$: tail -5000 access.log | awk '{freq[$11]++} END {for (x in freq) {print freq[x], x}}' | tr -d '"' | sort -rn | head -20
Top 20 IPs from the last 5000 hits
~$: tail -5000 access.log | awk '{print $1}' | sort | uniq -c | sort -rn | head -20
~$: tail -5000 access.log | awk '{freq[$1]++} END {for (x in freq) {print freq[x], x}}' | sort -rn | head -20
Top 20 URLs from the last 5000 hits
~$: tail -5000 ./access.log | awk '{print $7}' | sort | uniq -c | sort -rn | head -20
~$: tail -5000 ./access.log | awk '{freq[$7]++} END {for (x in freq) {print freq[x], x}}' | sort -rn | head -20
Top 20 URLs requested from a certain ip from the last 5000 hits
~$: IP=1.2.3.4; tail -5000 ./access.log| grep $IP | awk '{print $7}' | sort | uniq -c | sort -rn | head -20
~$: IP=1.2.3.4; tail -5000 ./access.log | awk -v ip=$IP ' $1 ~ ip {freq[$7]++} END {for (x in freq) {print freq[x], x}}' | sort -rn | head -20
real time analysis with apachetop
HowTo: monitor your website in real time with apachetop
/usr/sbin/apachetop -f /path/to/your/log/access.log
Eclipse PDT: Suche einen Ausdruck, der über mehrere Zeilen geht (multiline search)
Um in Eclipse PDT einen Ausdruck zu suchen, der sich möglicherweise über mehrere Zeilen streckt, kann die Option „Regulärer Ausdruck“ verwendet werden.
Beispiel: Es sollen alle Stellen gefunden werden, in denen nach einem Komma („,“) unmittelbar – abgesehen von Leerzeilen und Leerzeichen) eine geschweifte Klammer („}“) folgt.
Dazu im Suchfenster die Option „Regulärer Ausdruck“ markieren und folgenden Ausdruck im Suchfeld eingeben: ,(\R|\s?)*}
