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
;
atouch() {
mkdir -p $(sed 's/\(.*\)\/.*/\1/' <<< $1) && touch $1
}
and then, execute it with one argument:
atouch B/C/D/myfile.txt
Just a simple command below is enough.
mkdir a && touch !$/file.txt
Thx
you can install the script ;
pip3 install --user advance-touch
After installed, you can use ad command
ad airport/plane/captain.txt
airport/
├── plane/
│ ├── captain.txt