Rm rf * inside directory

Hi, I was trying to delete all content from a folder which was inside a mounted device (mnt/data/downloads) and navigated to that folder and ran rm -rf * and immediately remembered that this could be the infamous command and cancelled it after like 5 seconds.

Everything seem to be working however I’m afraid I could have deleted any crucial files. Does this command run at root level or did it ran inside the folder?

Thanks!

You are safe, if you used it inside folder.

Yes I did, but it was taking a while hence the reason why I’ve cancelled it. What does it do inside the folder?

Deletes everything, all folders and files inside.

Which folder where you in? I hope not

/

just as a hint, always use the full path while removing files/folder like

rm -Rf /mn/test/folder/to/delete/*

He was in /mnt/data/downloads

Ok, so I was doing the right thing anyway. That’s what I wanted but cancelled afraid it could possibly be using the root as path reference. :joy:

did this one on my real job as admin 15 years ago. :see_no_evil:

All it takes is one time…ask me how I know :smiley: