If you are a Linux user, you may have encountered situations where you need to count the number of files in a directory. For example, you may want to know how many files you have downloaded, how many images you have stored, or how many scripts you have written.
Source: LXer – Count Files in a Directory in Linux: 5 Easy Methods