Category Archives: linux

Trouver les fichiers plus grand que 10 Mo

find / -size +10000000c -printf “%15s %pn”

Posted in astuces, linux | Leave a comment

Trouver les fichiers modifiés dans les deux jours

find / -mtime 2 -o -ctime 2

Posted in astuces, bash, linux | Leave a comment

NB SYN SUR UN PORT PARTICULIER

Exemple sur le port 80: tcpdump -ne dst port 80 and ‘tcp[13] & 2 == 2′ Pratique  pour detecter un SYN FLOOD

Posted in astuces, bash, linux, network, reseau | Leave a comment

STATS NOMBRE DE CONNEXION LINUX

Exemple sur le port 80 netstat -tan | grep ‘:80 ‘ | awk ‘{print $6}’ | sort | uniq -c

Posted in astuces, bash, linux | 1 Comment

Trouver les 50 repertoires les plus lourds

du -S / | sort -nr | head -n50

Posted in bash, linux, shell | Leave a comment

Changer l’adresse mac

passer en root ifconfig eth0 hw ether AA:BB:CC:DD:EE:FF

Posted in bash, ifconfig, linux, mac, network, shell | Leave a comment

Rappels shell

Parfois vous pouvez vous simplifier la vie, il vous suffit de taper un des motifs suivants (source : “man sh”) : !n Rappelle la commande numéro “n”. !-n Rappelle la commande exécutée il y a “n” commande(s). !! Rappelle la … Continue reading

Posted in bash, linux, shell | Leave a comment

Dernier argument employé avec bash

ls -ail /home !$ prend la valeur du dernier argument utilisé echo !$ va renvoyer /home

Posted in bash, linux, shell | Leave a comment

Récupérer le nombre total d’octet transféré sur une interface

Remplacez “eth0″ par l’interface concernée. Octets reçus : /sbin/ifconfig eth0 | grep bytes | sed -e “s/TX.*//g” | sed -e “s/.*RX/RX/g” Octets envoyés : /sbin/ifconfig eth0 | grep bytes | sed -e “s/.*TX/TX/g” Les deux : /sbin/ifconfig eth0 | grep … Continue reading

Posted in bash, linux, reseau, shell | Leave a comment

Récupérer l’adresse ip publique (vue depuis internet)

L’appel à iconv n’est nécessaire que si votre système utilise utf8 comme jeu de caractères par défaut (ce qui devient de plus en plus courant) au lieu d’iso8859-1 (latin-1). wget -q www.monip.org -O ip.tmp && cat ip.tmp | iconv -f … Continue reading

Posted in bash, linux, reseau, shell | Leave a comment