Making rm slightly safer


Lots of people alias rm to rm -i for the sake of safety. Another thing that helps is not typing rm -rf ./files and instead typing rm -rf files. The ./ prefix is easily mistyped, and can lead to any of the following scenarios:

  • rm -rf . / files
  • rm -rf ./ files
  • rm -rf . /files
  • rm -rf ./files

The 1st one will wipe your current directory and then try to wipe the whole computer. The next 2 wipe your current directory. Only the last one does what you want.

So why risk it? Don’t type ./. It doesn’t make the command less ambiguous anyway.

Related Posts

Random Thought: LC Theorem

I finally have an answer to "who's your favorite singer?"

My Top Tip for Helping People Get Started Programming

GPT-f

Random paper on angles

An Image is Worth 16x16 Words

Random stuff

Lossless Data Compression with Neural Networks by Fabrice Bellard

Downscaling Numerical Weather Models With GANs (My CI 2019 Paper)

Learning Differential Forms and Questions