I was editing a file with vi and crashed so when I opened the file again I had the .swp file to deal with. I made the wrong choice trying to recover my file and wound up with a file with no eol (end of line) characters.
I have forgotten the code to substitute and don't want to make an even bigger mess. What I see now are thousands of ^@ characters.
After I thought I had recovered the file I gave the command
mv .[filename].swp [filename]
The .file.swp file is the editing state file for vi (or vim) for the file named file. If vi died or our system died while you were editing the file, the way to recover your file is to execute the following commands:
You can then compare file and _file to see if you got the version you wanted. Then you should remove .file.swp before you edit the file again.
Since the swap file is a binary file (not a text file), you probably don't want to use the mv command you tried. If you haven't modified the file after moving the swap file to your original file name, you can move it back to its swap file name and then try the steps I outlined above.
Last edited by Don Cragun; 09-30-2013 at 01:34 AM..
Reason: Fix autospell checking induced errors.
Hi Solaris Folks :),
I need to calculate the swap usage on solaris server, please let me understand the output of below swap -s and swap -l commands.
$swap -s
total: 1774912k bytes allocated + 240616k reserved = 2015528k used, 14542512k available
$swap -l
swapfile dev swaplo... (6 Replies)
The only way I know of is manually as follows:
To remove for example ^M from a file:
- vi the file name that has ^M at the end of each line.
- Hit <Esc>
- Type :g/
- Hold the CNTRL key and press V and M then release the CNTRL key At the buttom you should see this by now: ... (3 Replies)
Hi
I have an integrity machine rx7620 and rx8640 running hp-ux 11.31. I'm planning to fine tune the system:
- I would like to know when does the memory swap space spill over to the device swap space?
- And how much % of memory swap utilization should be specified (swap space device... (6 Replies)
Hi All,
I am new to shell scripting but have successfully created some of my own scripts using awk and sed. However, I have come across a problem that I cannot solve on my own and have not been able to find a good example that relates to what I am trying to do.
What I need is for the... (4 Replies)
Hello and thanks in advance.
I have a Sun box with raid 1 on the O/S disks using solaris svm.
I want to unmirror my swap partition, and add the slice on the second disk as an additional swap device. This would give me twice as much swap space.
I have been warned not to do this by some... (3 Replies)
Hi,
I want to check whether file has EOL or NOEOL before opening this file in VI editor. My file is very big its in terms of 15-20 MB.
I am using ksh for this.
When we opened the file in vi editor, normally at last line we are able to see whether this is eol or noeol file. But i does want... (1 Reply)
Hi,
I am using ksh.
I have to find wether data file has EOL or not. as per my knowledge we can easily find by checking each character. But this is a tedious job as per my requirement because my data file size is very big . It may be in 25-30 MB.
So please advice me how i can check wether... (4 Replies)