Microsoft Windows Vista and 7 users
- Open Windows Explorer.
- Browse to the folder containing the files you wish to count. As shown in the below picture, in the bottom left portion of the window it will display how many items (files and folders) are in the current directory.
Microsoft Windows XP users
- Open Windows Explorer.
- Browse to the folder containing the files you wish to count.
- Highlight one of the files in that folder and press the keyboard shortcut CTRL + A to highlight all files and folders in that folder. Once all files have been highlighted, in the Explorer status baryou'll see how many files and folders are highlighted as shown in the below picture.
www.windowslinux.co.inMicrosoft command line (DOS) users
- Open the Windows command line.
- Move to the directory containing the files you wish to count and use the dir command to list all files and directories in that directory. If you're not familiar with how to navigate and use the command line, see our How to use the Windows command line (DOS) page.
As can be seen in the above example, at the bottom of the of the dir output you'll see how many files and directories are listed in the current directory. In this example, there are 23 files and 7 directories on the Desktop.
To list the count of files in Linux use the ls command piped into the wc command as shown below.
ls -1 | wc -l
To prevent any confusion, the above command reads ls ls . This command uses the ls command to list files in a bare format and pipes the output into the wc command to count how many files are listed. When done properly, the terminal should return a single number indicating how many lines were counted and then return you to the prompt.
You can also add the grep command to find a more exact count of the files you wish to count as shown below.
ls -1 | grep ^a | wc -l
In this above example, the command will only count files that being with the letter a. The regular expression ^a could be replaced with any valid grep command or you could just replace the letter a with another letter.
MacOS users
- Open the folder containing the files you want to count.
- In that folder you should see at the bottom center of the window how many objects are listed, as shown in the below example picture.
No comments:
Post a Comment
Do not post irrelevant comments, please!