Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Windows CMD, I use tree c: /f to get a tree of all directories resided in C:. But now I only want to tree out the only sub-directory folders (not files). How to I exclude files in tree command?

share|improve this question
up vote 15 down vote accepted

Leave out the "/F" switch, since it's what causes Files to be included.

From tree /?:

Graphically displays the folder structure of a drive or path.

TREE [drive:][path] [/F] [/A]

   /F   Display the names of the files in each folder.
   /A   Use ASCII instead of extended characters.
share|improve this answer
beat me to it... – Lamar B Dec 29 '11 at 3:09
@Ƭᴇcʜιᴇ007 Is there a way we can print this output to text or other file – Pravin Waychal Dec 1 '15 at 7:29

to output to txt file use command: (you will find in on drive C, as specified below)

tree /a > "C:\_TREE-Output.txt"
share|improve this answer
This duplicates another answer and adds no new content. Please don't post an answer unless you actually have something new to contribute. – DavidPostill Mar 15 at 9:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.