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

Microsoft Windows users
MS-DOS 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 of.
  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. This makes your Explorer or My Computer display 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 in the right side of the status bar; otherwise, highlight the file you want to view the size of and view the status bar.

In addition to the above steps, Windows users can also see the file sizes through MS-DOS using the steps shown below.

MS-DOS 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

    If you needed to see how much space multiple files of a certain extension are, type the above command. In this case, it would display the space all txt files in the current directory are taking. Additional wildcard examples like the one above can be found on our wildcard definition.

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

  • See the disk capacity and file definitions for further information and related links.