Linux: How to Make a Directory Command

To make a directory (i.e., create a new directory) on a Linux system, you can use the mkdir command. Here’s how to do it:

  1. Open a terminal window on your Linux system.
  2. Navigate to the location where you want to create the new directory using the cd command. For example:
cd /home/yourusername

This will navigate to the /home/yourusername directory.

  1. Use the mkdir command to create a new directory. For example, to create a directory called “mynewdir”, enter the following command:
mkdir mynewdir

This will create a new directory called “mynewdir” in the current location.

  1. You can also create a directory with multiple levels by specifying the full path of the new directory. For example, to create a directory called “mynewdir” inside a directory called “myotherdir”, which is inside the /home/yourusername directory, enter the following command:
mkdir /home/yourusername/myotherdir/mynewdir

This will create a directory called “mynewdir” inside “myotherdir”, which is inside the /home/yourusername directory.

By using the mkdir command, you can create new directories and organize your files and folders on your Linux system.

Leave a Comment