To check a successfull migration I'm using find
to count the number of files, directories, symbolic links and files with more than one hard link. As the directories to check contain a huge number of files, each find
run takes several hours. Thus I search for a way to separately count number of files, directories, symbolic links and files with more than one hard link within a single find
run.
Here's what I currently do
num_files=$(find $directory -type f | wc -l)
num_directories=$(find $directory -type d | wc -l)
num_symlinks=$(find $directory -type l | wc -l)
num_hardlinks=$(find $directory -type f -links +1 | wc -l)
How can I get those four counters within one find
run?
rsync
. But I need to proof that rsync copied all files, directories, symbolic links and hard links and I don't know a better way than doing it withfind
.