How to Create a Folder in Ubuntu 24.04

April 9, 2025 / Ubuntu

In this guide, you will learn three methods of creating a folder in Ubuntu 24.04.

Creating folders (directories) in Ubuntu 24.04 is crucial for organizing files and managing data efficiently. Whether you are using the terminal or the graphical user interface (GUI), Ubuntu provides multiple ways to create folders with ease.

Let us follow the steps:

Method 1: Using the Graphical User Interface (GUI)

  1. Open the File Manager: Click on the “Files” application from the dock or search for it in the applications menu.
  2. Navigate to the Desired Location: Browse to the directory where you want to create the new folder.
  3. Create the Folder:
    • Right-click on a space.
    • Select “New Folder” from the context menu.
    • Type a name for the folder and press Enter.

Method 2: Using the Terminal

  1. Create a Folder in the Current Directory
    Ubuntu’s terminal offers a quick and efficient way to create folders using the mkdir command.

    1. Open the terminal (Ctrl + Alt + T).
    2. Type the following command and press Enter:
      mkdir myfolder

      This creates a folder named myfolder in the current directory.

  2. Create a Folder in a Specific Directory
    To create a folder in another location, specify the full path:

    mkdir /home/username/Documents/myfolder

    Replace your username with your actual Ubuntu username.

  3. Create Multiple Folders at Once
    You can create multiple folders simultaneously by listing them:

    mkdir folder1 folder2 folder3
  4. Create Nested Folders
    To create a folder inside another folder (nested directories), use the -p option:

    mkdir -p parentfolder/childfolder

    This guarantees that parentfolder is created first if it doesn’t already exist.

Method 3: Using a Shell Script (For Automation)
If you regularly need to create folders, you can automate the process using a shell script:

  1. Open the terminal and create a script file:
    nano create_folder.sh
  2. Add the following script:
    #!/bin/bash
    mkdir -p /home/username/Documents/myfolder
    echo “Folder created successfully!”
  3. Save and exit (Ctrl + X, then Y, then Enter).
  4. Make the script executable:
    chmod +x create_folder.sh
  5. Run the script:
    ./create_folder.sh

Creating folders in Ubuntu 24.04 is simple using both the GUI and the terminal. The “mkdir” command is mainly useful for quickly creating directories, while the GUI method is user-friendly for beginners. Automating folder creation with shell scripts can further improve efficiency. Whether you are managing files or organizing projects, these methods will help you streamline your workflow.

Read More: How to Install Python 3 on Ubuntu 20.04 or 22.04

Leave a Reply

Your email address will not be published. Required fields are marked *