This is in three parts. First, we use find to locate all *.bak files (case insensitive), then have it run the du command on them. Using -Bk means the output will all be in kilobytes

Then, we pass the output of that to cut, parsing only the numbers before the 'K' that du puts after the number, so we have a stream of integers, one per line.

Now, pass that to paste, which will concatenate all ines together, separated by a delimiter (a plus sign in this case). paste normally wants a file, but using the trailing - tells it to take its input from STDIN

At this point, we have a formula, fs1+fs2+fs3, which we simply pass to bc. It calculates the results of the formula, and prints the result on the output.

As above, but also count the number of files. Warning: This only works in bash, zsh and ksh. Will not work in dash or sh (or bash in sh mode)

Here, we've added the tee command so we can pass it to wc. Since the output of wc will not go to the output, but instead be passed to paste, we redirect the output to /tmp/a, then cat that file when done.