Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get a list of folders and sub folders without the files?

I am trying to print a list of the folders and sub folders of a directory to a file.

When I run dir /s/b/o:n > f.txt, I get a list of the files also. I only need the folders and sub folders.

Anyone know is this possible to do this from command line interface?

like image 627
Inkey Avatar asked Apr 18 '13 08:04

Inkey


People also ask

How do I copy a folder and subfolders without files?

Type "xcopy", "source", "destination" /t /e in the Command Prompt window. Instead of “ source ,” type the path of the folder hierarchy you want to copy. Instead of “ destination ,” enter the path where you want to store the copied folder structure.

How can I get a list of all the subfolders and files present in a directory using PHP?

PHP using scandir() to find folders in a directory The scandir function is an inbuilt function that returns an array of files and directories of a specific directory. It lists the files and directories present inside the path specified by the user.

How do I print a list of files in a folder and subfolders in Windows 10?

Select all the files, press and hold the shift key, then right-click and select Copy as path. This copies the list of file names to the clipboard. Paste the results into any document such as a txt or doc file & print that. Then open notepad, open tempfilename, and print it from there.


1 Answers

Try this:

dir /s /b /o:n /ad > f.txt 
like image 109
Endoro Avatar answered Oct 13 '22 05:10

Endoro