Sometimes the simplest things to do are the hardest. This definitely applies to IT as once you learn something it often seems that things are simple. However, for a complete newbie that is further from the truth.
Case in point trying to view the folders and files within a Docker Container. I don't know Linux so using Unraid is quite the learning curve. What seems simple to Linux users is totally foreign to someone like me.
Yes, I can eventually find the correct blog post and trawl through reddit, youtube and the like. I'll eventually find my answer but by the next time I need to problem solve or do something I've forgotten what little Linux terminal commands I have learnt.
Anyway, back to the issue at hand and wanting to view the folder structure contained within a Docker Container.
Seemingly a simple thing to do and it is if you know what you are doing. However, for a first or second time user maybe not. This is where I come in.
Pre-requisites
In this example, the following is the setup.
- Running Unraid 6.12.10
- Any Docker container you have installed and running. In this example, NGINX.
Step by Step Instructions
Below I list the high level process and following that you get the step by step instructions.
- Open the Docker Container using Console.
- Start Bash.
- Enter command(s) in Console to view files and folders.
Step 1: Open Docker Container using Console

A blank terminal window will appear, similar to below image.

Step 2: Start Bash
Type "bash" then the [Enter] key in the Console. A window will appear, similar to below image.

Step 3: Enter command(s) in Console to view files and folders.
There are a numer of options that can be used. I will list a few options. Please do your own search if you require a more extensive list of possible commands.
- Use the ls command to list the contents of the current directory: ls.
- Use the ls -a command to list all files and folders, including hidden ones: ls -a.
- Use the tree command to display a tree-like representation of the directory structure: tree.
Option 3a: ls - list the contents of the current directory
Type ls and [Enter] key.

Option 3b: ls -a (list all files and folders, including hidden ones)
Type ls -a and [Enter] key.

Option 3c: tree (isplay a tree-like representation of the directory structure)
Type tree and [Enter] key.

Please support this channel: Have I saved you minutes, hours or even days of scouring the internet to find an actual working solution.
It takes me time and effort to both find a working solution and then write everything up. Please consider buying me a coffee so I can keep producing useful content, especially if I've made your life easier. Cheers!
Bonus Material: Colour Coding in the Console
In the Console you will note that some items are colour coded. This is because the colour provides additional information. The lightish blue colour indicates that it is a folder.

Bonus Material: Basic file and folder commands
ls -l | list files and folders and show their permiisions |
cd - | (goes back to previous directory) |
cd directoryName | (goes to specified directory) |
mkdir directoryName | (make specified directory) |
0 Comments