5

I am trying to delete a file that is owned by root from Emacs dired opened as a regular user.

I get the following error:

(file-error Removing old name Permission denied /opt/file)

How can I execute this command with root privileges?

  • There is a package called dired-toggle-sudo – stardiviner Feb 4 '18 at 6:04
5

Use Tramp. Instead of running dired in /opt, run it in /sudo::/opt. This gives you root permissions.

| improve this answer | |
1

Put the cursor on the line with the file and type: ! sudo rm

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.