Handy One-Liners

Aus RZ-Amper Wiki
Version vom 10. Juni 2020, 21:02 Uhr von WikiSysop (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „Stripp of HTML Tags sed -e 's#<[^>]*>##g' Extract Page Title wget www.web.de -q -O - | grep -i "<title>" | /usr/local/bin/sed -n 's/.*<title>\(.*\)<\/titl…“)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen

Stripp of HTML Tags

 sed -e 's#<[^>]*>##g'

Extract Page Title

 wget www.web.de -q -O - | grep -i "<title>" | /usr/local/bin/sed -n 's/.*<title>\(.*\)<\/title>.*/\1/ip;T;q

Find String in Files

 find ./ -type f -exec grep -l searchstring {} \;

Using Rsync

 rsync -av -e ssh source user@target:dest

Using Rsync on LAN

 rsync -avW -e ssh source user@target:dest

AWK, pint first row

 tail -1000 file.log | grep -i "irgendwas" | awk -F"Delimeter" '{print $1, $2}'

Grep for "schreischachtl" in apache access log file, grep for "POST", get ip address and count wich ip address accessed how often.

 grep "schreischachtl" access_log | grep "POST" | awk -F"-" '{print $1}' | uniq -c