{"id":9226,"date":"2020-01-23T10:04:54","date_gmt":"2020-01-23T10:04:54","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=9226"},"modified":"2020-05-28T06:40:18","modified_gmt":"2020-05-28T06:40:18","slug":"ubuntu-linux-unix-vi-error-swap-file-swp-already-exists","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/ubuntu-linux-unix-vi-error-swap-file-swp-already-exists\/","title":{"rendered":"Ubuntu, Linux, Unix  vi error: swap file .swp already exists"},"content":{"rendered":"\n<p><strong>Command that gave me  error:<\/strong><br><code>vi .env<\/code> or vi &lt;any file name that starts with a &#8220;.&#8221; that means it&#8217;s a hidden file><\/p>\n\n\n\n<p><strong>Error<\/strong>:<br> Swap file .env.swp already exists<br>or<br> Swap file xxx already exists <\/p>\n\n\n\n<p><strong>Solution:<\/strong><br> <code>ls -A <\/code> (This will show you if a .swp file really existd)<br><code>rm .filename.swp<\/code> (This will delete the .swp file which was generated while you closed the session accidentally while editing the original file)<\/p>\n\n\n\n<p><strong>Verify the solution:<\/strong><br> <code>ls -A <\/code> (Now you won&#8217;t see the .swp file that you deleted using the above command) <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Command that gave me error:vi .env or vi &lt;any file name that starts with a &#8220;.&#8221; that means it&#8217;s a hidden file> Error: Swap file .env.swp already existsor Swap file&#8230; <\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4957],"tags":[],"class_list":["post-9226","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=9226"}],"version-history":[{"count":10,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9226\/revisions"}],"predecessor-version":[{"id":9241,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9226\/revisions\/9241"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=9226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=9226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=9226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}