Skip to main content
added 86 characters in body
Source Link
terdon
  • 252.7k
  • 69
  • 481
  • 719

Your command already descends into subdirectories (unless /bin is a link, see below) but it will skip links and other non-regular files because you are explicitly telling find to only return regular files. That's what -type f means. From man find:

   -type c
          File is of type c:

          f      regular file

To find everything, just remove the -type:

find /bin/ -exec md5sum {} + >>sum.md5

Note the / at the end of /bin/: that is needed in case your /bin is a symlink (as it often is a symlink to /usr/bin on modern Linux systems). Without it, the command will only return the symlink itself (/bin) and will not descend into subdirectories.

If you later want to verify these checksums, just run:

md5sum -c sum.md5 

Your command already descends into subdirectories (unless /bin is a link, see below) but it will skip links and other non-regular files because you are explicitly telling find to only return regular files. That's what -type f means. From man find:

   -type c
          File is of type c:

          f      regular file

To find everything, just remove the -type:

find /bin/ -exec md5sum {} + >>sum.md5

Note the / at the end of /bin/: that is needed in case your /bin is a symlink (as it often is a symlink to /usr/bin on modern Linux systems). Without it, the command will only return the symlink itself (/bin) and will not descend into subdirectories.

Your command already descends into subdirectories (unless /bin is a link, see below) but it will skip links and other non-regular files because you are explicitly telling find to only return regular files. That's what -type f means. From man find:

   -type c
          File is of type c:

          f      regular file

To find everything, just remove the -type:

find /bin/ -exec md5sum {} + >>sum.md5

Note the / at the end of /bin/: that is needed in case your /bin is a symlink (as it often is a symlink to /usr/bin on modern Linux systems). Without it, the command will only return the symlink itself (/bin) and will not descend into subdirectories.

If you later want to verify these checksums, just run:

md5sum -c sum.md5 
Source Link
terdon
  • 252.7k
  • 69
  • 481
  • 719

Your command already descends into subdirectories (unless /bin is a link, see below) but it will skip links and other non-regular files because you are explicitly telling find to only return regular files. That's what -type f means. From man find:

   -type c
          File is of type c:

          f      regular file

To find everything, just remove the -type:

find /bin/ -exec md5sum {} + >>sum.md5

Note the / at the end of /bin/: that is needed in case your /bin is a symlink (as it often is a symlink to /usr/bin on modern Linux systems). Without it, the command will only return the symlink itself (/bin) and will not descend into subdirectories.