What does the command "find ~/folder-name -type f | wc -l" do?
The context Also, could you take a look at the context that suggested by @VolkerSiegel in her/him comment here.
12 Answers
Let's split it into parts: find ~/folder-name -type f | wc -l
findis a program for, well, finding files and folders:~/folder-nameis the directory in whichfindwill try to find files/folders-type ftellsfindto look only for files (and not directories, special files, etc.)
wcis a program to count characters, words, and lines in some text (a file, or the input that you give it).-ltells it to only count lines.
|sends the output offindtowc.
All told, it counts the total number of files in the directory ~/folder-name, and all its sub-directories. In your case you have 1305252 files, not counting links, directories and other special files. That's a pretty big number (IIRC a MATLAB installation has around 500000 files, less than half that, and still takes forever to delete). That would go a long way in explaining the long times. The sheer amount of time find took should be hint.
As another reference point, my own home directory, with a total size of 361GB spanning a few partitions has only 282747 files (one fourth of your number!).
It counts (wc -l) the number of regular files (-type f) that are found - recursively - in the directory ~/folder-name.