Handy One-Liners: Unterschied zwischen den Versionen

Aus RZ-Amper Wiki
Zur Navigation springen Zur Suche springen
(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…“)
 
 
Zeile 19: Zeile 19:
 
Grep for "schreischachtl" in apache access log file, grep for "POST", get ip address and count wich ip address accessed how often.
 
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
 
   grep "schreischachtl" access_log | grep "POST" | awk -F"-" '{print $1}' | uniq -c
 +
 +
Create bootable USB flash drive
 +
  sudo dd bs=4M if=path/to/input.iso of=/dev/sd<?> conv=fdatasync  status=progress

Aktuelle Version vom 24. April 2021, 12:04 Uhr

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

Create bootable USB flash drive

 sudo dd bs=4M if=path/to/input.iso of=/dev/sd<?> conv=fdatasync  status=progress