So many ways to do it, although it should be noted that this may be undesirable - normally you verify a pre-computed md5 hash by looking at a file that contains both the md5 hash and the file name (exactly the format that the md5sum application puts it out in). You might want to look at Wikipedia's
article on md5sum for information on how it is normally used.
As for what you are apparently trying to do -
We know that the standard output of md5sum is going to be a 32 character hexadecimal
string. Therefore we can
cut the first 32 characters to grab just the hash:
Since we know that the first non-hash character is a space, we can set that to be our delimiter, and then grab the first field:
Alternatively, we know that the hash will be the first
word in the output, so we can just print the first word:
We could use the split command to break it into multiple files, based on the byte size: