1

I was able to access rc.local just a little bit ago and now it wont let me. I cant even delete the swp file due to permission issues. Im not sure where to go from here, the error i get when opening the rc.local file is

Error reading lock file /etc/.rc.local.swp: Not enough data read.

When i try to delete the swp file i get

rm /etc/.rc.local.swp

rm: remove write-protected regular empty file '/etc/.rc.local.swp'? y

rm: cannot remove '/etc/.rc.local.swp': Permission denied

asked Apr 8, 2019 at 22:36
1
  • just fixed the problem, had to use sudo to remove .rc.local.swp //it is a real file Commented Apr 8, 2019 at 23:59

1 Answer 1

3

.*.swp files are created by the vi editor to log changes so that the undo command can work.

They are created with the same permissions as the file they are logging in the same directory. Because the name starts with a period they are hidden.

If you've used sudo vi /etc/rc.local and created /etc/.rc.local.swp you'll need to use sudo rm /etc/.rc.local.swp to remove it.

answered Apr 9, 2019 at 1:03

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.