Issue
I am trying to create a directory structure in Unix. I made the directory using mkdir command with -p option but when i use "touch" to create files i get hit with the "No such file or directory error"
The code i tried .
mkdir -p livingthings{birds/{flyingbirds,nonflyingbirds},plants,animals/{mammals,reptiles}}
touch livingthings/{birds/{flyingbirds/{stork,eagle,eider},nonflyingbirds/{kiwi,ostrich,penguin}},plants/{carrot,cabbage,daisy},animals/{mammals/{jaguar,dog,tiger},reptiles/{alligator,skink,turtle}}}
This is the error which pops out
Help much appreciated.
UPDATE : After adding the "/" i get one error now that is telling
touch: cannot touch 'livingthings/animals/reptiles/turtle': No such file or directory .:
Solution
The issue is you missed the slash after livingthings in mkdir -p livingthings/{birds..... not mkdir -p livingthings{birds.... Because of this it creates a directory named livingthingsbirds instead of livingthings/birds. But then in your touch command u r using livingthings/ so thats why it cant find that directory.
Answered By - rootkonda