3 ms·
let's remember the the -p option is cool, but could cause pain if you mis-type one of the directories. for example: $ cd $ ls tmp - some files lists -
by protomyth 17y ago
let's remember the the -p option is cool, but could cause pain if you mis-type one of the directories. for example:
$ cd
$ ls tmp
- some files lists -
$ mkdir -p tmm/a/b/c
oops (remember your esc key)
- nagrom 17y agoWhy would this cause you any more pain than normal? You can just remove that chain with rm -r, surely?
- nitrogen 17y agormdir -p might be a bit safer, but it can get greedy and remove all the way up to root if you specify an absolute path.
- protomyth 17y agonormally you would get an error on the first mkdir, but you could be tired and just using your history and changing the commands and realize a little late you did a lot of stuff somewhere you shouldn't. I had a bad night once with this (still use the -p anyway, but...).