E325: ATTENTION Found a swap file by the name "~/.zshrc.swp" owned by:

This is the error message I have been getting from following an instructional video for a computer science course, and when my laptop got an unexpected shut-off.


E325: ATTENTION

Found a swap file by the name "~/.zshrc.swp"

     owned by: Jay  dated: Thu Mar 04 04:49:41 2021

     file name: Jay/.zshrc

     modified: YES

     user name: Jay  host name: Jay-MBP

    process ID: 7800

While opening file "/Users/Jay/.zshrc"

       dated: Thu Mar 04 04:52:08 2021

   NEWER than swap file!


(1) Another program may be editing the same file. If this is the case,

  be careful not to end up with two different instances of the same

  file when making changes. Quit, or continue with caution.

(2) An edit session for this file crashed.

  If this is the case, use ":recover" or "vim -r /Users/Jay/.zshrc"

  to recover the changes (see ":help recovery").

  If you did this already, delete the swap file "/Users/JewooLee/.zshrc.swp"

  to avoid this message.


Swap file "~/.zshrc.swp" already exists!

[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:


Then, when I press r, I get the following message:


Last login: Thu Mar 4 04:49:28 on ttys000


The default interactive shell is now zsh.

To update your account to use zsh, please run `chsh -s /bin/zsh`.

For more details, please visit https://support.apple.com/kb/HT208050.

Jay-MBP:~ Jay$ vim ~/.zshrc

Jay-MBP:~ Jay$ vim ~/.zshrc

Jay-MBP:~ Jay$ vim ~/.zshrc

Jay-MBP:~ Jay$ vim ~/.zshrc

Jay-MBP:~ Jay$ vim ~/.zshrc

Jay-MBP:~ Jay$ vim ~/.zshrc

Jay-MBP:~ Jay$ vim ~/.zshrc













     file name: ~Jay/.zshrc

     modified: YES

     user name: Jay  host name: Jay-MBP

    process ID: 7193

8.  .zshrc.swo

     owned by: Jay  dated: Thu Mar 04 03:12:04 2021

     file name: ~Jay/.zshrc

     modified: YES

     user name: Jay  host name: Jay-MBP

    process ID: 4932

9.  .zshrc.swp

     owned by: Jay  dated: Thu Mar 04 04:49:41 2021

     file name: ~Jay/.zshrc

     modified: YES

     user name: Jay  host name: Jay-MBP

    process ID: 7800

  In directory ~/tmp:

   -- none --

  In directory /var/tmp:

   -- none --

  In directory /tmp:

   -- none --


Enter number of swap file to use (0 to quit): 


Please help me with this error, I am having so much trouble trying to fix this issue.


Thank you.

Posted on Mar 3, 2021 6:56 PM

Reply
1 reply

Mar 4, 2021 10:56 PM in response to JayLee0502

I won't be much help since I don't have any experience with zsh configurations. However, it would be helpful to know exactly what you were doing when this happened. If you were following a publicly available video, then posting a link would help as well. If you were using the Terminal, then providing a list of the commands you were using may help us to know what happened. You can either use the up arrow key to scroll through a list of previous commands or you can list the commands (using " | tail" will show the last ten lines, but this can be modified as well):

history  |  tail


The error message tells you to delete the "/Users/JewooLee/.zshrc.swp" file if you attempted to recover it, but it didn't solve the problem. Did you try deleting this file? You may need to close the Terminal app and re-launch the Terminal.


If you were modifying any system file, then you should always make a backup copy of the file you will be modifying first in case a mistake is made in editing a file since it isn't always easy to remember all the changes made. Plus you should have a system backup anyway as an added precaution in general. You may also want to consider installing macOS into a Virtual Machine so that you don't risk the main OS when experimenting. Virtual Box is a free VM. If you are using an M1 Mac, then a VM may not be an option. In that case installing macOS to an external drive would be better than breaking the main OS on the built-in drive.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

E325: ATTENTION Found a swap file by the name "~/.zshrc.swp" owned by:

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.