How do I determine the size of a file or folder?
Microsoft Windows users
Below are the different steps you can take to determine the total size of a file, multiple files, or folder on a computer running Microsoft Windows.
- Locate and highlight the file(s) or folder for which you want to determine the size.
- Right-click the file, and then click Properties.
- As can be seen in the image below, you can determine the size of the file or files you have highlighted from in the file properties window. In this example, the chrome.jpg file is 18.5 KB (19,032 bytes), and that the size on disk is 20.0 KB (20,480 bytes).
or
- Open My Computer or Windows Explorer
- Make Windows display file properties by clicking on View at the top of the window, and then selecting Details. Once this action has been completed, your Explorer displays all your files, their sizes, type, and last modified date.
or
- Open My Computer or Windows Explorer
- Move to the directory containing your file.
- If you want to see the total space of the current directory, view the size of the directory on the right-side of the status bar. Otherwise, highlight the file you whose size you want to view and look at the status bar.
Tip: You can also select multiple files and once all of the files you want are highlighted right-click on any of the highlighted files and choose Properties. In the Properties window, it shows the size of all files combined.
macOS X users
- Locate the file or folder whose size you would like to view.
- Click once on the file or folder.
- Press Command + I on your keyboard.
- A window opens and shows the size of the file or folder.
MS-DOS and Windows command line users
The following instructions contain information on the different methods a user can utilize to view the size of a file or files in MS-DOS.
- Move to the directory of the file whose size you want to view.
- Once in the directory, perform one of the following commands:
dir myfile.txt
The above command shows the size of the single file myfile.txt.
dir *.txt
The above command lists all text files in the current directory, as shown in the picture below.
As seen in the above example, this shows there are five txt files in the current directory with a total size of 124,264 bytes.
- For additional wildcard examples, see our wildcard definition.
- See the cd command and dir command pages for further information about each of these commands.
Linux and Unix users
Below are some of the different methods a *nix user can use to determine a size of a file on their computer.
- Move to the directory of the file whose size you want to view.
- Once in the directory, perform one of the following commands:
Command 1:
ls -l help.html
Command 1 output:
-rw-r----- 1 comphope www 11567230 Nov 24 01:12 log.txt
In the above output example, the 11567230 is the size of the file. For a more user-friendly output, use the du command as shown below.
Command 2:
du -h log.txt
Command 2 Output:
12M log.txt
If you want to see the total size of multiple files, type the following:
du -ch *.txt
The above example command lists every .txt file in the current directory, as well as the size of each of those files and the total size of all the files combined.
Additional information
- How much is 1 byte, kilobyte, megabyte, gigabyte, etc.?
- See the disk capacity and file definitions for further information and related links.
- Computer file help and support.