It's nearly on daily basis I get annoyed about bad and weird Bash and command line usage, often dealing with commands such as RM.
On Linux, there's no Recycle Bin ... so, instead of taking risks ... well, why not take any risks ?
How ? Well, TRY to do this (and I don't manage but I work on it), never never never never run:
or
or certainly not
Not in command line, and CERTAINLY never in a script (or document).
Always use a path, a part of a path, or just something extra.
There is so much less damage you can do with :
Certainly if you behold the fact that on Linux a and A is different.
For the love of whatever, don't use the CD command and then run RM with only a star.
Like this:
Warning: DO NOT RUN THESE COMMANDS.
However, they say the best way to learn is to make mistakes.
I also did, well, 23 years ago, but I just bother about other people looking for problems.
The problem is: they force me to use scripts with these things, or documentation with the same.
Don't be that guy.
Or girl.
On Linux, there's no Recycle Bin ... so, instead of taking risks ... well, why not take any risks ?
How ? Well, TRY to do this (and I don't manage but I work on it), never never never never run:
rm *
or
rm -f *
or certainly not
rm -rf *
Not in command line, and CERTAINLY never in a script (or document).
Always use a path, a part of a path, or just something extra.
There is so much less damage you can do with :
rm a*
Certainly if you behold the fact that on Linux a and A is different.
For the love of whatever, don't use the CD command and then run RM with only a star.
Like this:
cd /what/could/go/wrong
rm *
Warning: DO NOT RUN THESE COMMANDS.
However, they say the best way to learn is to make mistakes.
I also did, well, 23 years ago, but I just bother about other people looking for problems.
The problem is: they force me to use scripts with these things, or documentation with the same.
Don't be that guy.
Or girl.