Neil Bothwick lives in a Tux shaped house powered by Linux, honest!
Graphical file managers let you view the contents of a directory or one of its subdirectories, as do the ls and dir commands in the shell. Most graphical managers also let you view directories in a tree format, where you can see both subdirectories and their contents in a single view. There is an often-overlooked shell command that does much the same and it goes by the unsurprising name of tree .
We’d love to try to answer any questions you send to answers@linuxformat.com, no matter what the level. We’ve all been stuck before, so don’t be shy. However, we’re only human (many suspect Neil checked out long ago), so it’s important that you include as much information as you can. If something works on one distro but not another, tell us. If you get an error message, then please tell us the exact message and precisely what you did to invoke it.
Q Virtually full disk
Run with no arguments, tree prints a listing of the files and directories in the current directory and those below it. As with ls , you can pass the name of a directory to list and there are several options that alter the output. Some of the most useful are in the table.
If you have, or suspect, a hardware problem, let us know about the hardware. Consider installing hardinfo or lshw. These programs list the hardware on your machine, so send us their output. If you’re unwilling, or unable, to install these, run the following commands in a root terminal and send us the system.txt file, too.
I have a fairly old version of Linux Mint Xfce installed in a VirtualBox virtual machine. The size of the virtual disk is roughly 20GB and now 18GB has been taken up. How can I find big packages so I can see whether they have been used, and remove them as needed?
There are plenty more options, including the ability to output in XML, HTML or JSON, control the colourisation of output and much more. The man page details them all. It’s not a replacement for ls , but tree is a more of a complement to it, each of the commands performing useful but different functions.