400 read by owner 040 read by group 004 read by anybody 200 write by owner 020 write by group 002 write by anybody 100 execute by owner 010 execute by group 001 execute by anybody
The following grep will return each filename containing the given text :
grep -Ril "text"
-R
Read all files under each directory, recursively.-i
case-insensitive search-l
Print the file name for each match. This is the default when there is more than one file to search.
The following grep will match all email adresses @gmail.com :
grep -RIHEo "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" . | grep gmail.com
-R
Read all files under each directory, recursively.-I
Process a binary file as if it did not contain matching data.-H
Print the file name for each match. This is the default when there is more than one file to search.-E
Interpret PATTERN as an extended regular expression.-o
Print only the matched (non-empty) parts of a matching line, with each such part on a separate output line.
To generate list file from addresses found :
grep -RhIEo "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" . | grep gmail.com | sort -u > mails.txt
-h
disables filename printingsort -u
removes duplicates
lsof -p PID
- PID = Process ID
du -hs ~/web/* | sort -h
du -hs ~/web/* | sort -hr
systemctl disable NeworkManager
nmcli con mod My\ Connection ipv4.addresses 10.1.1.250/24
nmcli con mod My\ Connection ipv4.gateway 10.1.1.1
nmcli con mod My\ Connection ipv4.dns 8.8.8.8
nmcli con up My\ Connection
sudo iwlist wlo1 scan | grep ESSID | sort -u
wpa_passphrase mySSID myPass | sudo tee -a /etc/wpa_supplicant/wpa_supplicant.conf
sudo wpa_supplicant -c /etc/wpa_supplicant/wpa_supplicant.conf -i wlo1 -B
sudo dhclient -v wlo1
sudo ip addr add 192.168.112.45/24 dev myNetworkInterface
sudo ip route add default via myGateway dev myNetworkInterface
grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}"