Skip to main content

Command Palette

Search for a command to run...

How to Create and Display File Structure on Linux

Updated
1 min read
How to Create and Display File Structure on Linux
G

I am an IT enthusiast currently studying at Christ Academy Bengaluru. I love Linux and passionate about the gaming platforms.

In this blog post, we will learn about Linux file system hierarchy concepts. Files and Directories are organized into a single-rooted inverted tree structure. The filesystem begin at the "root" directory, represented by a lone "/" (forward slash) character. Names are case-sensitive and paths are delimited by a "/".

Syntax:

mkdir <directory name>
cd <directory name>

Example:

Let us try to create a file system structure as shown in the following format:

.
└── India
    └── Karnataka
        └── Bangaluru
            └── South-Bangaluruu

Follow the below commands to create such file/directory structure:

% mkdir Asia
% cd asia
% mkdir India
% cd India
% mkdir Karnataka
% cd Karnataka
% mkdir Bangaluru
% cd Bangaluru
% mkdir South-Bangaluruu



% cd ../../..

Output:

% tree
.
└── India
    └── Karnataka
        └── Bangaluru
            └── South-Bangaluruu

4 directories, 0 files