🖥️inotifywait
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the inotifywait command with important options and switches using examples.
2 minute read
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██╗███╗ ██╗ ██████╗ ████████╗██╗███████╗██╗ ██╗██╗ ██╗ █████╗ ██╗████████╗
# ██║████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝╚██╗ ██╔╝██║ ██║██╔══██╗██║╚══██╔══╝
# ██║██╔██╗ ██║██║ ██║ ██║ ██║█████╗ ╚████╔╝ ██║ █╗ ██║███████║██║ ██║
# ██║██║╚██╗██║██║ ██║ ██║ ██║██╔══╝ ╚██╔╝ ██║███╗██║██╔══██║██║ ██║
# ██║██║ ╚████║╚██████╔╝ ██║ ██║██║ ██║ ╚███╔███╔╝██║ ██║██║ ██║
# ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝
inotifywait -e open art.jpg && s=$(stat -c %s art.jpg );h=$(($s/2));r=$((s-h)); dd if=/dev/urandom | grep -a -o -P "[\x01-\xD0]" | tr -d $'\n' | dd of=art.jpg bs=1 seek=$h count=$r
# Digitally "shred" half a file after it is opened.
#Block all brute force attacks in realtime (IPv4/SSH)
# Was to long with a loop, use a while loop for have it running 24/7
inotifywait -r -q --format %w /var/log/auth.log|grep -i "Failed pass"|tail -n 1|grep -oE '\b([0-9]{1,3}\.){3}[0-9]{1,3}';iptables -I INPUT -i eth0 -s "$(cat /var/log/auth.log|grep "authentication failure; l"|awk -Frhost= '{print $2}'|tail -n 1)" -j DROP
inotifywait -m -r -e close_write . | while read dir op file ; do [[ "$op" =~ CLOSE ]] && cp -va "${dir}${file}" ../saved/ ; done
# Use inotifywait on Linux to *try* to copy a file (outside the tree) after it's closed and before it's removed. Note: This may not be fast enough.
# Block all brute force attacks in realtime (IPv4/SSH) -> Was to long with a loop, use a while loop for have it running 24/7
inotifywait -r -q --format %w /var/log/auth.log|grep -i "Failed pass"|tail -n 1|grep -oE '\b([0-9]{1,3}\.){3}[0-9]{1,3}';iptables -I INPUT -i eth0 -s "$(cat /var/log/auth.log|grep "authentication failure; l"|awk -Frhost= '{print $2}'|tail -n 1)" -j DROP
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command inotifywait in a clear format. This allows users to quickly access the needed information for inotifywait without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for inotifywait are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.