bash get one checksum for many files

# Basic syntax:
find /directory/to/search -type f -exec md5sum {} + | awk '{print $1}' | sort | md5sum > single_md5sum.txt

# Where:
#	- find -type f returns all files (but not directories) in 
#		/directory/to/search and its subdirectories
#	- -exec md5sum {} obtains the md5 checksums for all files returned 
#		with find
#	- awk '{print $1}' | sort returns the sorted md5 checksums
#	- and finally, md5sum is run on the sorted list of md5 checksums to
#		return one md5 checksum for all the files

3.89
9

                                    # Basic syntax:
md5sum /path/to/directory/* > list_of_checksums

# Note, md5sum will run on any files that are found with your search
# 	pattern. For example:
md5sum /path/*/*files_I_want* > list_of_checksums
# This would process all files than contain the substring "files_I_want"
# in all directories in the "path" directory

3.89 (9 Votes)
0
0
0

                                    # Basic syntax:
md5sum /path/to/directory/* > list_of_checksums

# Note, md5sum will run on any files that are found with your search
# 	pattern. For example:
md5sum /path/*/*files_I_want* > list_of_checksums
# This would process all files than contain the substring "files_I_want"
# in all directories in the "path" directory

0
0
Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source