Skip to content

Creating and removing directory structures on Linux

Managing directories on Linux is easy, but the process gets more complex when you need to create, empty or remove large, complex directory structures. This post will take you from the most basic commands to some fairly complex ones that can help make the process easier.


The mkdir command can create a single directory like this:

$ mkdir newdir

It can also create a complex directory and subdirectory structure with a command like the one below. The -p argument tells the command to create the base directory if it doesn’t already exist.

Each group of directory names that appears in the command shown – like {1,2,3} and {docs,script} – will result in a series of subdirectories being created at that level.

To read this article in full, please click here

Source:: Network World – Linux