How do I determine the size of a file or folder?

Microsoft Windows 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.

  1. Locate and highlight the file, files, or folder you want to determine the size.
  2. Right-click the file and click Properties.
  3. Within the file Properties, you can determine the size of the file or files you have highlighted. As seen in the below properties window the size of the chrome.jpg file is 18.5KB (19,032 bytes) or size on disk is 20.0KB (20,480 bytes).

File properties in Windows

or

  1. Open My Computer or Windows Explorer
  2. Make Windows display the file properties by clicking on View at the top of the window and selecting Details. Once done, your Explorer displays all your files, their sizes, type, and modified date.

or

  1. Open My Computer or Windows Explorer
  2. Move to the directory containing your file.
  3. 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 want to view the size of and view the status bar.

Windows users can also see the file sizes through MS-DOS using the steps shown below.

MS-DOS and Windows command line users

Below are the different methods a user can use to view the size of a file or files in MS-DOS.

  1. Move to the directory of the file you want to view the size.
  2. Once in the directory, perform one of the below commands.

dir myfile.txt

In the above example, if you wanted to see the size of the file "myfile.txt", you would type this command to see the size of that single file.

dir *.txt

The above command would list all text files in the current directory as shown in the picture below.

Size of files in the command line

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.

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.

  1. Move to the directory of the file you want to view the size.
  2. Once in the directory, perform one of the below commands.

ls -l help.html

Performing the above command would list output similar to the below information.

-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.

du -h log.txt

This command would display the output "12M log.txt"

If you want to see the total size of multiple files, type a command similar to the below command.

du -ch *.txt

In the above example, the command would list every .txt file in the current directory, display the size of each of those files as it was listing the files, and the total of all the files combined.

Additional information