• • Windows command line and MS-DOS users •. • Navigate to the directory containing the content you'd like a list to print. If you're new to the command line, familiarize yourself with the and the. • Once in the directory you want to print the contents of, type one of the below commands. Dir > print.txt The above command takes a list of all the files and all of the information about the files, including size, modified date, etc., and sends that output to the print.txt file in the current directory. Dir /b > print.txt The above command would print only the file names and not the file information of the files in the current directory. Dir /s /b > print.txt The above command would print only the file names of the files in the current directory and any other files in the sub-directories within the current directory.
Print A Directory List By Using Windows PowerShell. Printing or saving a directory listing using PowerShell is an easy, straightforward process.
• After executing any of the above commands, the print.txt file is created. Open this file in any text editor (e.g., ) and print the file. You can also Notepad from the command prompt by typing notepad print.txt. Once in Notepad you can like any other file. Tip: If you have another default text editor you can also use the and start the file to open the file in the default text editor.
For example, type start print.txt to open the file in the default text editor. Linux users • Navigate to the directory you want to print. If you're new to Linux, you need to familiarize yourself with the Linux and the. • Once in the directory you want to print the contents of, type the below command. Ls > print.txt The above command will print all of the files in the current directory and any sub-directories to the print.txt file.