Yep, my friend made a similar mistake.
He meant rm -rf music
But typed rm -rf /music
Deleted his whole music collection which was very important to him. I felt so bad for him. I had given him the little bit of Linux knowledge he had when he switched to Linux and made that mistake.
To avoid rm mistakes in the future, you could set an alias that always provides the “-i” flag which makes the command prompt you with y/n before the deletion. Another solution is to alias rm for trash-cli commands to move files to the trash like when you delete files in your graphical file manager.
Yep, my friend made a similar mistake. He meant rm -rf music But typed rm -rf /music
Deleted his whole music collection which was very important to him. I felt so bad for him. I had given him the little bit of Linux knowledge he had when he switched to Linux and made that mistake.
To avoid rm mistakes in the future, you could set an alias that always provides the “-i” flag which makes the command prompt you with y/n before the deletion. Another solution is to alias rm for trash-cli commands to move files to the trash like when you delete files in your graphical file manager.