And I always write the WHERE clause before the DELETE or UPDATE keywords.
And I always write the WHERE clause before the DELETE or UPDATE keywords.
I sometimes get nervous typing 'rm -r' commands, since it starts with a very broad path, and only narrows-down as we type more, e.g. if we hit enter prematurely when typing 'rm -r ~/Downloads/archive.zip' we might delete our entire home directory, or all of our downloads.
For this reason I often prefix dangerous steps with 'echo'; once I'm confident it's correct, I'll then run the script and double-check that variables/flags/etc. expanded as expected; and only then will I remove the echoes.
(I was surprised to learn that on some systems, the flags are in a fixed position, at the start!)
Almost always, if I'm inputting `rm` manually in a shell, I don't need `--`; very few filenames on my disk start with -.
rm * .o
I was puzzled by the message ".o: No such file", and then understood why...
Now, I always start with ls and if satisfied of the output, replace ls with rm