Search files containing string
grep -rnw ./ -e "string"
Totally override destination with source
rsync -avh --delete (--dry-run) /path/to/source/ /path/to/destination/
Find services that uses specific file
#Quick way, process id list fuser /path/to/file #Versatile way, more info list lsof /path/to/file
What files does specific process id uses
lsof -p 12345
What files ...Read more
I have to do with linux firewall iptables quite rarely, that's why I never remember commands I need. I'm going to list them here as they will come on my way.
List rules with line numbers:
iptables -L --line-numbers
Deny all acces from IP, in case of DDOS or Auth-attack:
iptables -A INPUT -s 126.96.36.199 -j DROP
Remove rule by line number: