9

Back in my (sucky) Windows days, I used the tree command to view the file hierarchy in a pretty display. I am aware of the find command, but to actually process any data in my clogged 241,416 folders/files from just checking each line is as possible as time travelling...

./build/CMakeFiles/cmake.check_cache
./build/CMakeFiles/Makefile.cmake
./build/CMakeFiles/CMakeTmp
./build/CMakeFiles/TargetDirectories.txt
./build/CMakeFiles/compilerid.dir
./build/CMakeFiles/compilerid.dir/depend.make
./build/CMakeFiles/compilerid.dir/flags.make
./build/CMakeFiles/compilerid.dir/DependInfo.cmake
./build/CMakeFiles/compilerid.dir/link.txt
./build/CMakeFiles/compilerid.dir/build.make
./build/CMakeFiles/compilerid.dir/cmake_clean.cmake
./build/CMakeFiles/compilerid.dir/main.o
./build/CMakeFiles/compilerid.dir/CXX.includecache
./build/CMakeFiles/compilerid.dir/progress.make
./build/CMakeFiles/compilerid.dir/depend.internal
./build/cmake_install.cmake
./build/CMakeCache.txt
./build/Makefile
./build/compilerid
./CompilerID.kdev4
./.kdev4
./.kdev4/CompilerID.kdev4
./main.cpp

Output of find on one folder holding the files of a one-file, incomplete C++ project

On Windows, the tree command gave a diagram-like output that is human readable

Screenshot of tree command in command prompt Screenshot of the pretty tree command

So, my question is, is there anything graphically close to the Windows/DOS tree command?

3
  • 6
    there's a tree command for linux Jun 14, 2014 at 18:37
  • @SylvainPineau Yes, by to search for it, it didn't have very similar wording, plus, Stack Exchange's search engines are so embarrassingly awful
    – user280208
    Jun 15, 2014 at 9:41
  • I like that you specified that your Windows days were sucky (even though that goes without being said). Dec 27, 2018 at 20:40

2 Answers 2

11

Same command exist. To install, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo apt-get install tree

enter image description here

7
  • 2
    I know how to open up the Terminal ;-)
    – user280208
    Jun 14, 2014 at 18:46
  • 3
    @Abdullah0v0 Nothing wrong with extra information ;) Besides, someone else who reads the question/answer might need that tip ;)
    – Dan
    Jun 14, 2014 at 20:09
  • 2
    For better convenience, I'd pair tree with less when using it for easier scrolling functionality. $ tree | less
    – Dan
    Jun 14, 2014 at 20:12
  • 4
    @Dan Even better: tree -C | less -R preserves colours.
    – Bakuriu
    Jun 15, 2014 at 7:50
  • 2
    @Bakuriu Didn't know about the -R switch. Thanks! Jun 15, 2014 at 22:26
6

You have tree command in linux. All you have to do is install it. It works very similar to the one in windows.

sudo apt-get install tree