I use the command
find . -type f -exec sha256sum {} \; > sha256SumOutput
to hash every file in a folder hierarchy. Unfortunately, sha256sum
doesn't get the file names from find
in alphabetical oder. How can this be fixed?
I'd like to have them ordered before they are hashed so they are hashed in alphabetical order (this has a reason).
Using some pipes and
sort
Explanation
From
man find
From
man sort
From
man xargs
Example
The values in the first column are the same, as the files doesn' have any content in my test.
You should be able to just pipe your output from
find
tosort
.