Find the answer to your Linux question:
Results 1 to 3 of 3
Please forgive me if I am not posting this is the correct forum. I am extremely new at this, so please bare with me as I try to explain my ...
  1. #1
    Just Joined!
    Join Date
    Apr 2011
    Posts
    1

    VI Editor Help Please!

    Please forgive me if I am not posting this is the correct forum. I am extremely new at this, so please bare with me as I try to explain my problem. At work we are using Cisco Voip phones and when setting them up we first create a config file in vi editor. I first use a program called putty. I signed into the program and typed vi filename..cnf to edit a config file, well I accidently exited out of the program before typing the command in vi to quit (I know I am an idiot). Anyways I go back into putty and the vi editor and type command vi filename.cnf and the warning message i have highlighted in blue below appears...

    phn swap file by the name "filename.cnf.swp"
    owned by root
    filename: /tftpboot/filename.cnf
    modified: yes
    process ID: 5156
    While opening file "filename.cnf"

    1. another program maybe 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 filename.cnf"
    to recover the changes (see ":help recovery")
    if you did this already delete the swap file "filename.cnf.swp" to avoid this message.


    Does anyone know how I can find and delete the .swp file so I will not get this warning? I know this is happening because I closed out of vi incorrectly. Like I said I am new to this, so please explain in detail as much as possible. Thanks!

  2. #2
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    1,939
    Does anyone know how I can find and delete the .swp file so I will not get this warning?
    It is a hidden file in whichever directory you were in. Your output would indicate it is in the /tftpboot directory - /tftpboot/filename.cnf.

    If you see it there and since it shows being owned by root, you need to be root to remove it with the command: rm .filename.cnf.swp

    Take care you're in the right directory and get the name of the file exactly right as shown in your directory.

  3. #3
    Trusted Penguin elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    2,298
    If you have unsaved changes try vim -r filename.cnf to recover the session.
    If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)


    My new blog. It's probably not as good as I think it is.

Posting Permissions

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