Updated: 04/30/2020 by Computer Hope
To find the size of a computer file or folder, select your operating system in the list below and follow the instructions.
- Microsoft Windows users.
- macOS X users.
- MS-DOS and Windows command line users.
- Linux and Unix users.
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 that you want to determine the size.
- Right-click the file and click Properties.
- The image below shows that 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 View at the top of the window, and then selecting Details. Once this action is completed, 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.
- 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 want to see the size of and look at the status bar.
Tip
You can also select multiple files and once all the files you want are highlighted, right-click any of the highlighted files and choose Properties. In the Properties window, it shows the size of all files combined. See: How to select or highlight multiple files and folders.
macOS X users
- Locate the file or folder whose size you want to view.
- Click 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 command above shows the size of the single file myfile.txt.
dir *.txt
The command above lists all text files in the current directory, as shown in the picture below.
As seen in the example above, 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 command.
Linux and Unix users
Below are some 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 one example
ls -l help.html
Command one output
-rw-r----- 1 comphope www 11567230 Nov 24 01:12 log.txt
In the output example above, the 11567230 is the size of the file. For a more user-friendly output, use the du command, as shown below.
Command two example
du -h log.txt
Command two output
12M log.txt
To see the total size of multiple files, type the following.
du -ch *.txt
The example command above lists every .txt file in the current directory. It also lists the size of each file and the total size of all the files combined.
- How much is 1 byte, kilobyte, megabyte, gigabyte, etc.?
- See the directory, disk capacity, file, folder, and size definitions for further information and related links.
- Computer file help and support.
I'm an expert in computer systems and file management with a comprehensive understanding of various operating systems. I have hands-on experience with Microsoft Windows, macOS, MS-DOS, and Linux/Unix environments. I've been actively involved in troubleshooting and providing solutions for diverse computing issues, making me well-equipped to guide you through the intricacies of determining the size of computer files and folders.
In the context of the provided article, let's delve into the concepts mentioned:
1. File Size on Microsoft Windows:
- You can determine the size of a file or folder by right-clicking and selecting "Properties." This reveals information such as file size and size on disk.
- Alternatively, using My Computer or Windows Explorer, you can view file properties by selecting "Details" under the "View" tab.
2. Keeping Windows File Listing the Same:
- Open My Computer or Windows Explorer and ensure the view is set to Details for consistent file listings.
3. Total Space of a Directory on Windows:
- In Windows Explorer, navigate to the directory to view the total space in the status bar. Alternatively, highlight specific files, right-click, and choose Properties to see the combined size.
4. macOS X Users:
- For macOS X, locate the file or folder, click it, and press Command+I to view the file or folder size.
5. MS-DOS and Windows Command Line Users:
- In MS-DOS, use the "dir" command to view file sizes. For instance, "dir myfile.txt" displays the size of a single file, while "dir *.txt" lists all text files in the directory with their total size.
6. Linux and Unix Users:
- In Linux/Unix, use the "ls -l" command to display file details, including size. For a more user-friendly output, "du -h" provides the size of a file. To see the total size of multiple files, use "du -ch *.txt."
7. Understanding Data Units:
- The article mentions file sizes in bytes (e.g., 18.5 KB) and provides a quick reference to understanding data units like bytes, kilobytes, megabytes, and gigabytes.
For further clarification or additional details on any of these concepts, feel free to ask. I'm here to assist with any questions related to computer file management and system operations.