Viewing the contents of a file.

Issue

Viewing the contents of a file.

Cause

It may be necessary to view the contents of a file to help discover what the file is or to view the data within the file.

Solution

Tip Keep in mind that most files are compiled or written to be only opened with a specific program. The below examples are used to open a plain text file. If you are unable to read the file or it appears to be garbage, gibberish, or encrypted when opened, it must be opened with the appropriate application. Make sure the program you need to open the file with is installed on the computer and that it is associated with the file. If you're not sure what program is used to open the file determine the file extension and review our file extension page for a listing of associated programs.

Below is a listing of how to view the contents of a standard file for each of the major PC operating systems.

Microsoft Windows users

Double-click the file that you wish to open. If the file is an un-associated file type you will receive a "Open With" window. If you are unfamiliar with what program to use to open this file try using wordpad or notepad to view the file.

If the file has already been associated but you wish to open it with a different program hold down the Shift key and right-click the file. This should open a drop down menu, select the Open With option and select the file you wish to open the file with.

MS-DOS and Windows command line users

Locate the file that you wish to view. In the below example we will be opening the file autoexec.bat in the directory that we are currently located in.

edit autoexec.bat

Note: If the file typed does not exist, was typed improperly or is empty you will just have a blank edit window.

Additional help and information about edit can be found on our edit page.

Additional MS-DOS users can use the type command to display the file contents but not modify them.

Unix / Linux users

How do I open, create, edit, or view a file in Linux?

Additional information