Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
How can I ensure that intermidiate components exist? Something like mkdir -p {} but without last component?
mkdir -p {}
假设你的路径是$f
$f
赶紧跑mkdir -p `dirname $f`
mkdir -p `dirname $f`