The fastest way to see what's inside a file from Command Prompt

You can display any file's contents directly in Command Prompt using the type command. This works for text files, configuration files, logs, and most documents you can read as plain text. The command is simple: type the filename, and Command Prompt shows you everything inside it on your screen.

This is faster than opening a file manager and double-clicking, especially when you're already working in Command Prompt or need to check multiple files quickly. It also works on files that don't have an associated program — you can read a .log file or .txt file without needing Notepad installed.

Key Takeaways

  • The type command displays file contents directly in Command Prompt without opening another program.
  • You need the full filename including the extension, or the path to the file if it's in a different folder.
  • Use type filename | more to pause long files so you can read them page by page instead of watching text scroll past.
  • The findstr command lets you search for specific words or phrases inside a file without reading the whole thing.
  • Binary files and images will display as garbled characters — the type command only works cleanly with text-based files.

Display a file in the current folder

Open Command Prompt and navigate to the folder containing your file. Type type filename.txt (replace filename.txt with your actual filename and extension) and press Enter. Command Prompt displays the entire contents on your screen.

If you're not sure what files are in the folder, type dir first to list everything. This shows you the exact filename and extension you need to type. Once you see the filename, use the type command with that exact name — including the extension like .txt, .log, .csv, or .ini.

Display a file from a different folder

You don't have to navigate to the file's location. Type the full path instead: type C:\Users\YourName\Documents\filename.txt. Replace the path with wherever your file actually is. Command Prompt reads the file and displays its contents without moving you to that folder.

If the folder name or filename contains spaces, wrap the entire path in quotation marks: type "C:\Program Files\MyFolder\my file.txt". Without the quotes, Command Prompt stops reading at the first space and can't find the file.

Read long files page by page

When a file is longer than your screen, text scrolls past too fast to read. Use type filename.txt | more to pause after each screen full of text. Press the spacebar to see the next page, or press Q to stop reading and return to the Command Prompt.

This works with files in other folders too: type C:\path\to\filename.txt | more. The pipe symbol (|) sends the output to the more command, which handles the pausing. This is especially useful for log files that can be hundreds of lines long.

Search for specific text inside a file

Instead of reading an entire file, use findstr "search term" filename.txt to find lines containing specific words. Command Prompt displays only the lines that match, which saves time when you're looking for one piece of information in a large file.

For example, findstr "error" logfile.txt shows only lines containing the word "error". You can search for phrases too: findstr "connection failed" logfile.txt. Add the path if the file is elsewhere: findstr "error" C:\logs\system.log. The search is case-insensitive by default, so "Error", "ERROR", and "error" all match.

Combine type and findstr for faster searching

You can use both commands together to search and then pause the results. Type findstr "search term" filename.txt | more to find matching lines and display them page by page. This is useful when a search returns many results and you want to read through them without everything scrolling off screen at once.

You can also save the results to a new file instead of displaying them: findstr "error" logfile.txt > errors.txt. This creates a new file called errors.txt containing only the lines with "error" in them. You can then open that file in Notepad or display it with the type command.

What to do when the file won't display

If you see an error like "The system cannot find the file specified", check three things: the filename spelling, the file extension, and the path. Type dir to list files in your current folder and verify the exact name. If the file is in a different folder, make sure the path is correct — use backslashes between folder names, not forward slashes.

If the file displays as garbled characters or symbols, it's a binary file (like an image, video, or compiled program) rather than a text file. The type command can't read these cleanly. For binary files, use File Explorer to open them with the correct program instead.

Frequently Asked Questions

Can I display a file without typing the full path?

Yes, if you navigate to the file's folder first. Type cd C:\path\to\folder to move to that location, then use type filename.txt. After that, you can type any file in that folder without the full path. Type cd .. to move up one folder level.

What's the difference between type and more?

The type command displays file contents. The more command pauses the display so you can read it page by page. They work together: type sends the content, and more controls how fast it appears. You can use more with other commands too, not just type.

How do I display only the first few lines of a large file?

Command Prompt doesn't have a built-in command like Linux's head command. Use type filename.txt | more and press Q after reading the first page, or open the file in Notepad and scroll to see the beginning. For log files, you can often find the oldest entries at the top.

Can I display multiple files at once?

Yes. Type type file1.txt file2.txt file3.txt to display them one after another in the same output. You can also use wildcards: type *.txt displays all .txt files in the current folder. Use the pipe to more command if the output is long: type *.txt | more.

What if the filename has special characters or spaces?

Wrap the filename in quotation marks: type "my file (1).txt". This tells Command Prompt to treat the entire string as a single filename. Without quotes, Command Prompt stops at the first space or special character and can't find the file.