Does rm -rf /mnt/ delete files in subfolders if you do not have write access to /mnt/?
1
vote
1
answer
369
views
I accidentally ended up with
rm -rf some-text-folder-I-had-already-deleted-previously.txt /mnt/
because of arrow up into bash history.
My screen flashed with lots of subfolders that I actually do have write permissions for (I don't have write permission for /mnt/, so even the mount folders inside /mnt/ have been created with sudo mkdir) but all of the lines ended with Operation not permitted (and I stopped the command before it could finish).
I am worried that files inside those folders might have been deleted because a df -h
the previous day showed one file server volume **85%** and 24 hours later it's **83%**. But I do have some scripts cleaning up old files on that file server volume, so that could be the reason.
Since the stuff up, I haven't been able to find any missing files (I even have two tree -ahfq daily outputs files that I have diff'ed, but the ones missing from file2 are not actually deleted as far as I can see).
Can a simple rm -rf /mnt/
actually do harm to subfolders and files if I don't actually own or have write permissions to /mnt/
(owned by root etc as default on Ubuntu)?
Asked by jmkane
(111 rep)
Dec 15, 2022, 11:58 PM
Last activity: Dec 16, 2022, 12:16 PM
Last activity: Dec 16, 2022, 12:16 PM