Can't remove some files

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
whois1230
Level 4
Level 4
Posts: 215
Joined: Mon Aug 28, 2017 5:35 am

Can't remove some files

Post by whois1230 »

user@user ~ $ su
Password:
user user # rm /lib/udev/rules.d/72-touchpad.rules
rm: cannot remove '/lib/udev/rules.d/72-touchpad.rules': Is a directory
user user # cd /lib/udev/rules.d
user rules.d # rm 72-touchpad.rules
rm: cannot remove '72-touchpad.rules': Is a directory
user rules.d # cd
user ~ # cd /usr/local/sbin
user sbin # rm toggle-touchpad.sh
rm: cannot remove 'toggle-touchpad.sh': Is a directory
user sbin # cd
user ~ # exit
exit
user@user ~ $
How could I remove these files?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Termy
Level 12
Level 12
Posts: 4248
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: Can't remove some files

Post by Termy »

Directories, if empty, are removed with the rmdir command. If a directory contains files within it, you'll need to use the -r argument with rm; this will delete recursively; be careful. Have a look at man rm and man rmdir as well.
I'm also Terminalforlife on GitHub.
Locked

Return to “Beginner Questions”