Tag Archives: shell - Page 4

Un pot de miel pour application web

Un tuto plutôt pas mal pour créer un pot de miel à l’aide d’un fichier Robots.txt et de scripts shell pour sécuriser l’accès à un site web.

[article]
[source]

Go straight to Post

Enumérer les types de fichiers sous Linux et Unix

La version ligne de commande :

  1. find . -print|xargs file|awk ‘{$1= »";x[$0]++;}END{for(y in x)printf(« %d\t%s\n« ,x[y],y);}’|sort -nr

La version script :

  1. #!/bin/sh
  2. find . -print | xargs file |
  3. awk ‘{
  4. $1= »";
  5. x[$0]++;
  6. }
  7. END {
  8. for (y in x) printf(« %d\t%s\n« , x[y], y);
  9. }’ | sort -nr
Ce qui aura pour effet d’afficher sur la console quelques chose comme ça :
9025     gzip (.gz) compressed data
2235     ascii text
2080     empty
16       directory
6        shell script – ksh (Korn shell)
3        data or International Language text
2        shell script – sh (default shell)
1        tar archive
1        compressed data block compressed 16 bit
1        c program text
1        PKZIP (.zip) compressed archive

Go straight to Post

Page 4 sur 41234