Suppose my current directory is A. I want to create a directory B and a file \"myfile.txt\" inside B.
How to do th
You could create a function that parses argument with sed;
sed
atouch() { mkdir -p $(sed 's/\(.*\)\/.*/\1/' <<< $1) && touch $1 }
and then, execute it with one argument:
atouch B/C/D/myfile.txt