Create a new directory in Linux using commands like mkdir or cd followed by the path.
Create a new directory in Linux using commands like mkdir or cd followed by the path.
Hello . linux noob here! , currently studying linux within a cyber course im attending to and i have an assignment im having a hard time figuring out with just google in hands. i wanted to know if theres a way to create a folder and subfolders within that folder in just one command. i managed to do something like that - Mkdir support ; mkdir support/support{1..3} but i was wondering , as this is pretty much two codes in one line , if theres a way to do the same with a single command. Thanks upfront!
Create directory structure using command line tools. Refer to manual for available commands.
you can achieve this by using a single command with a wildcard. instead of repeating the pattern multiple times, you can leverage shell expansion or a loop construct. for example, in bash you could write: `mkdir -p support/*` which will create all subfolders up to depth 3 automatically. if you need more than 100, you’d need to adjust the depth or use a script to generate the names dynamically.