If you use the mkdir to create a directory inside a directory you would get an error,
# mkdir dir1/dir2 mkdir: cannot create directory 'dir1/dir2': No such file or directory
To create a nested directories like dir1/dir2 you need to pass in an optional argument -p or --parents along with it.
# mkdir -p dir1/dir2/dir3
Have Questions? Post them here!
- ls command: sort files by name alphabetically A-Z or Z-A [Linux/Unix/macOS/Bash]
- How to check uptime of Linux/Unix/macOS system/server using console command?
- How to create tar.gz file using Terminal Command
- How to List All Users in Linux
- How to check file permissions for your file using Linux/Unix/macOS Terminal Command
- How to exit from nano command
- How to go to the End of File in Nano Editor
- ls command sort by file size [Linix/UNIX/macOS/bash]
- scp: ssh: connect to host xxxx port 22: Connection refused Error
- How to tar.gz a directory or folder Command
- Linux: Create a New User and Password and Login Example
- How to install npm on Ubuntu
- Create and write file in single Linux/macOS command
- 3 ways to clear screen on Linux Terminal
- How to ls command to output one entry per line [macOS/Linux/Bash]
- Execute .bin and .run file Ubuntu Linux
- How to install and Configure sar sysstat tools in Ubuntu Linux
- Fix - ssh-copy-id no identities found error
- Terminal display next month Calendar
- Install Java Runtime Environment (Oracle or open JRE) on Ubuntu
- Fix - bash: man: command not found
- How to install curl on Alpine Linux
- Command to unzip or extract tar.gz file on Linux or macOS?
- How to Display content of a file in Terminal Screen?
- Copy entire directory using Terminal Command [Linux, Mac, Bash]
- Git Rename master branch make to main using Command - Git
- Bash Hello World! Script Tutorial - Bash
- [fix] Java NullPointerException ComparableTimSort countRunAndMakeAscending when sorting a List - Java
- Create a Zip file using Java Code programmatically - Java
- Notepad++ Mark and Copy feature - NotepadPlusPlus
- Add Blank Lines Between Each Lines in Notepad++ - NotepadPlusPlus
- How to Change Mouse Wheel Scroll Direction on Mac - MacOS
- Your JBoss Application Server 7 is running However you have not yet added any users to be able to access the admin console - Java