Find the answer to your Linux question:
Results 1 to 10 of 10
hi all...when i was editing my XFree86 files, suddenly the electricity at my home was gone. After several minutes, everything was OK and i reboot my pc. And when i ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2007
    Posts
    51

    [RESOLVED] how to delete swap file


    hi all...when i was editing my XFree86 files, suddenly the electricity at my home was gone. After several minutes, everything was OK and i reboot my pc. And when i want to edit the same file again, a message appear saying that there is swap file saved with the extension filename.swp when my system crashed. how can i delet it to avoid seeing the msg everytime i want to edit the file.

  2. #2
    Linux Newbie
    Join Date
    Feb 2007
    Location
    San Antonio, TX
    Posts
    114
    it should say the name of the file in that message, something like:
    .filename.swp

    just delete that file and it will stop bugging you

  3. #3
    Just Joined! sanjaykatiyar's Avatar
    Join Date
    Mar 2007
    Location
    Bangalore
    Posts
    97
    Actually swap file is hidden so type .filename.swp to delete this:

    $ rm -f .filename.swp

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Jan 2007
    Posts
    51
    seems nothing delete...when i want to open the file..the messge saying that i have a swp file still appear.

  6. #5
    Linux Newbie
    Join Date
    Feb 2007
    Location
    San Antonio, TX
    Posts
    114
    type
    ls -a

    and look for a file called .filename.swp, that's what you want to delete

  7. #6
    Just Joined!
    Join Date
    Jan 2007
    Posts
    51
    generally, where is the .swp file is located? in the same directory of the original file?

  8. #7
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Code:
    find -iname *.swp
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  9. #8
    Linux Newbie
    Join Date
    Feb 2007
    Location
    San Antonio, TX
    Posts
    114
    Quote Originally Posted by sintaq
    generally, where is the .swp file is located? in the same directory of the original file?
    yes, if you do
    ls -a
    you should see the file you're opening, and right before/after it will be the swap file

  10. #9
    Just Joined!
    Join Date
    Jan 2007
    Posts
    51
    thanx for guiding me...i find it and able to delete the swap file. when i editing the original file..the msg doesnt appear anymore.. thanx all!

    hi devils_casper...still remember me? seems like u have news avatar! hehehe

  11. #10
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Hi sintaq,

    i do remember you. and yes, i have changed my avatar.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •