Taking ownership of folders
I use Linux Mint 21.2 Cinnamon. I'm trying to clean up my system after uninstalling Turboprint.
I used Synaptic Package Manager to delete the package, but got this readout at the end. (Reading database ... 827268 files and directories currently installed.) Removing turboprint (2.55-1) ... Processing triggers for man-db (2.10.2-1) ... (Reading database ... 825986 files and directories currently installed.) Purging configuration files for turboprint (2.55-1) ... dpkg: warning: while removing turboprint, directory '/var/log/turboprint' not empty so not removed dpkg: warning: while removing turboprint, directory '/usr/share/turboprint/profiles' not empty so not removed dpkg: warning: while removing turboprint, directory '/etc/turboprint' not empty so not removed So I located '/var/log/turboprint' and tried to delete it, but my system said I don't have permission because I don't have ownership. How do I take ownership of the folder so I can get rid of it? I want to permanently delete all three: '/var/log/turboprint' '/usr/share/turboprint/profiles' '/etc/turboprint' Under Permissions, it says the first is owned by lp, the other two owned by root. Thanks for any help. |
remove as root eg
Code:
sudo rm -rf /path/to/folder |
Quote:
|
It should be noted that "sudo rm -rf" is a dangerous command that should be used with care.
Probably running as superuser/root (which is what the sudo does) is enough and the -f (force remove without prompt) is unnecessary. Using "sudo rm -ri /path/to/remove" makes it interactive - meaning you get a yes/no prompt before each file, and can use Ctrl-C to abort if you accidentally enter an incorrect path. (Aside: to change ownership, one can use chown command.) |
I think most rm's ( I read somewhere ) wont do rm -r on / without prompting, but yes any command run as root can be destructive, it's how we learn, I know I have accidently erased / because of carelessness, you only do it once or twice and you learn to back up often!
But the warning is right, I came back to this thread to add such a warning but u beat me to it! |
All times are GMT -5. The time now is 10:32 PM. |