LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Open VI? (https://www.linuxquestions.org/questions/linux-newbie-8/open-vi-410200/)

Ceyarrecks 01-31-2006 08:13 PM

Open VI?
 
I am having a difficult time finding how to OPEN a file already created with the command "vi BusinessAssociates"

I see I have a file by the name BusinessAssociates.swp.
in attempting to open in the way that rather made sense:
"vi BusinessAssociates.swp"

renders me this:

[root@Home-1 temp]# ls -a
. .. .BusinessAssociates.swp .BusinessAssociates.swp.swp
.PeronalAssociates.swp .swo .swp
[root@Home-1 temp]#

so exactly how does one *open* said file?

or does the . that proceeds the file name need to be included?

thanks
Cey

(yes, i know i am shown logged in as root, was on purpose for the task attempted)
also, if important or not, am using Fedora Core 4

microsoft/linux 01-31-2006 08:28 PM

yes, the '.' in front needs to be included. The '.' makes the file hidden, so if you just type
Code:

vi BusinessAssociates.swp
it'll open a new file.

DarkElf109 02-01-2006 12:23 AM

If all you have are swp files, which are used for when vi crashes, you may not be using vi properly. To exit vi, the command :q is given. To save, :w . To quit and save, :wq , and to quit WITHOUT saving is :q! (yes, include the '!'). By using these instead of whatever you were using before, you'll get proper saves of your files.

sohny 02-01-2006 03:37 AM

yes there are only swap files there . wat u can do is open tat swap in this way

vi .BusinessAssociates.swp

then when vi opens, type the following

:w BusinessAssociates

the colon is important

that will save the file in the way u want


All times are GMT -5. The time now is 04:39 PM.