1

Does Ubuntu have a command prompt like Windows and if so where do I find it to display the directory tree

  • If one of these answers solved your problem, just click the little grey under the number now turning it into beautiful green. This means "yes, this answer is correct"! ;-) If there are multiple answers that solve your problem please pick the best one. –  Jul 02 '16 at 11:48

2 Answers2

5

Yes, it does, it's called Terminal (gnome-terminal most likely). You can open it by searching for that name in the dash or by pressing CTRL + ALT + T.

You can also go into another TTY (your graphical session is running in one of them, probably number 7), to access them press CTRL + ALT + Fi (replace the i with whatever number you like, these are the function keys, so for your graphical system that would be F7).


  • If you want a tree of the directory and all of its sub-directories then I would suggest a tool called tree, it is not installed by default though so you will have to install it in Terminal with the command:

    sudo apt-get install tree
    

    Then it can be run with tree and you can find more information about how to use it in its manual page:

    man tree
    
  • If you just want to list the contents of a directory then the pre-installed tool ls should do the trick for you (just run it with that). It also has a man page accessed in the same way as with tree.

1

It's called a terminal, you can open it in your Desktop Environment (windowed terminal) by calling CTRL+ALT+T, or open the gnome-terminal software.

There's also the integrated console, you can access by using CTRL+ALT+F2, but you'll need to prove your identity.

For further information about the terminal, you can check the official wiki.


As for your secondary question, the linux equivalent of dir (Windows) is ls. To get help on using it, type:

ls --help

You can also use man ls for the complete manual.

Along with that command, you might find useful the cd command, with for example cd .. to get higher in the tree, and cd <mydirectory> to enter a subdirectory.

MrVaykadji
  • 5,875
  • 2
  • 32
  • 55
  • I don't think ls is what they want, tree will show a dir tree, ls just lists folder contents and not in a tree. – Mark Kirby Jul 02 '16 at 09:46