Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Color highlithing with grep
- tail -f /var/log/mail | grep --color -E '<regex>|$'
- # Print unvisible symbols
- LC_ALL="C" grep '^.*[^[:print:]]\+' имя_файла
- # Multiple grep with xargs
- grep from.*linux.domain.tld /var/log/mail|awk '{print $6}'|xargs -I{} grep {} /var/log/mail|grep "client="|awk '{print $7}'|sort|uniq -c
- # Extract all IP from log
- cat log.smbd*bz2|bunzip2|egrep -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'|sort -u
- watch "smbstatus 2>/dev/null |egrep -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'|sort -u >tmp.log && cat smb-ip.log >> tmp.log && cat tmp.log|sort -u > smb-ip.log && cat smb-ip.log|wc -l && cat smb-ip.log"
- # Search \t
- grep --perl-regex "CNAME\t${domain}"
- # Print N strings after found:
- grep -A<N> "found" file
- # Print N strings before found:
- grep -B<N> "found" file
- # Extract emails from file:
- grep -oe "[a-zA-Z0-9._]\+@[a-zA-Z]\+.[a-zA-Z]\+" emails.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement