delete files via rm

General support questions
Post Reply
mickey0
Posts: 63
Joined: 2015/06/16 22:44:38

delete files via rm

Post by mickey0 » 2024/04/10 18:16:10

Hello,
I accidentally run rm -fR on my home ~ directory, losing GBs. So now I'm trying to find out what directories were.
I stopped it while it was on /defaults as I realised it seeing that root permission was necessary. Any hints to see at least what directories been deleted?
Also am I at risk rebooting the system?

Kind regards.

edit: so I urge myself to know what directories before /defaults and after it...

lightman47
Posts: 1523
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: delete file via rm

Post by lightman47 » 2024/04/10 20:52:10

The only /default directory that I know of is in /etc and would require root permission. If this is the case in your situation, a reinstall may be the easiest.

mickey0
Posts: 63
Joined: 2015/06/16 22:44:38

Re: delete files via rm

Post by mickey0 » 2024/04/10 22:14:18

Hello,
actually I have a directory /defaults (with s at the end) in my user directory ~.
rm didn't delete anything which needs root permission. It tried to delete /defaults but a message informed me that roor privillege was necesary....
I'd like to know what I delete before rebooting...

User avatar
jlehtone
Posts: 4553
Joined: 2007/12/11 08:17:33
Location: Finland

Re: delete files via rm

Post by jlehtone » 2024/04/11 14:45:06

Default files for account are copied from /etc/skel.
See ls -laR /etc/skel
These you can restore by copy from /etc/skel. If you had modified them, that we can't help with.

When one starts a GUI desktop session, some additional directories do get created, like "Documents" and "Downloads".
New GUI session will recreate those, but any files you had added are on you.

Nothing creates content to home directory that would require root privileges. That must have been your doing.

Overall, the home has only (data) files and personal customizations/settings. Stuff that one should keep backups for.

User avatar
TrevorH
Site Admin
Posts: 33280
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: delete files via rm

Post by TrevorH » 2024/04/11 15:22:20

If you have no backup then you have most liklely lost those fles. If you want to attempt to recover them then you should STOP using the system immediately and shut it down. Now find some recovery media - perhaps systemcrescuecd - that includes a utility called photorec. This can attempt to recover deleted files and will (optionally?) write them to a different destination filesystem, maybe a USB stick?

I do not have a 'defaults' directory anywhere in any of my home directories. And if I did I would be surprised to find anything in my home directory that was not owned by my own user.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply