linux - How to create files and folders automatically through Terminal? -


how can grouped/generalised linux commands work on windows env? (using windows rt 2012). using git bash can't achieve following:

at project root, try following create lib folder , subfolders

mkdir -p lib/{login, signup, users, posts} touch !!:2/{package.json, index.js} 

the 1 below works want create these 2 files in each of login, signup, users, posts folders

touch package.json index.js  

thanks

edit : source

spaces villains

mkdir -p lib/{login,signup,users,posts} #no spaces in between comma & folder touch !!:2/{package.json,index.js} 

this expands

touch lib/{login,signup,users,posts}/{package.json,index.js} 

would work expected.

demystifying

touch !!:2/{package.json,index.js} 

the !! expands last command run , :2 expands third argument given argument count starts zero. also, arguments separated white-spaces default. in

mkdir -p lib/{login, signup, users, posts}  

the third argument turns out lib/{login, instead of expected lib/{login,signup,users,posts}, touch command expands as

touch lib/{login,/{package.json, index.js} 

which not desired expansion


Comments