Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Linux Mint 21.2 Victoria base: Ubuntu 22.04 jammy
Posts: 16
Rep:
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.
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.)
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,152
Rep:
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!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.