Table of Contents

Linux Commands Cheat Sheet

Linux Commands : md5sum

Checking File

# md5sum xxxxxxxx.iso


Checking Directory

Sample1

# rsync  -avz --delete /etc/ /etc.bk
# cd /etc
# find . -type f -exec md5sum {} \; > /tmp/md5.1
# cd /etc.bk
# find . -type f -exec md5sum {} \; > /tmp/md5.2
# diff /tmp/md5.1 /tmp/md5.2 |more

Sample2

Old Directory

# cd /usr/local/apache2/htdocs
# find . -type f -exec md5sum {} \; > /tmp/md5.out

New Directory

# cd /tmp/htdocs
# md5sum -c /tmp/md5.out > /dev/null && echo OK




Ref.

File Number

find /usr/local/apache2/htdocs  -type f | wc -l

Check Permittion

Sample1

# rsync  -avz --delete /etc/ /etc.bk
# tree -Dpuga /etc/ > /tmp/tree1
# tree -Dpuga /etc.bk/ >  /tmp/tree2
# diff /tmp/tree1 /tmp/tree2

Sample2

# tree -Dpuga /usr/local/apache2/htdocs/ > /tmp/tree.out
# tree -Dpuga /tmp/htdocs/ | diff - /tmp/tree.out