3 ms·
I always write rm <path> -rf for this reason (I was surprised to learn that on some systems, the flags are in a fixed position, at the start!)
by tux3 5y ago
I always write rm <path> -rf for this reason
(I was surprised to learn that on some systems, the flags are in a fixed position, at the start!)
- ndsipa_pomu 5y agoOne reason for having the flags before the <path> is so that you can terminate the flags by using '--'. This is especially useful to prevent dubious files being expanded that might start with '-' and be interpreted as flags that leads to unexpected results.
- tux3 5y agoNote that my Debian's `rm` happily supports terminating flags using `--` when necessary, so wanting to support `--` syntax doesn't have to come at the expense of writing -r last. Almost always, if I'm inputting `rm` manually in a shell, I don't need `--`; very few filenames on my disk start with -.