Create a new folder on linux bash touch
To create a new folder on Linux using the touch
command, you can't directly use touch
as it is used to create a new empty file. Instead, you can use the mkdir
command, which stands for "make directory".
Here's how you can create a new folder:
mkdir new_folder
This will create a new folder named new_folder
in your current directory.
If you want to create a folder with a specific path, you can specify the path along with the folder name:
mkdir /path/to/new_folder
Replace /path/to/
with the actual path where you want to create the folder.
If the folder already exists, mkdir
will not create a new one and will instead print an error message. If you want to create a new folder even if it already exists, you can use the -p
option:
mkdir -p /path/to/new_folder
This will create the folder and all its parent directories if they do not exist.