Sponsored Content
Full Discussion: No eol in swap file
Operating Systems OS X (Apple) No eol in swap file Post 302858255 by Don Cragun on Sunday 29th of September 2013 11:33:28 PM
Old 09-30-2013
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:
Code:
# create a back up in case recovery fails
cp file _file

# load the latest saved state of the file from the swap file and write it into file
vi -r file
:w
:q

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 12:34 AM.. Reason: Fix autospell checking induced errors.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Swap file

I just started working with AIX and need a little help. Is there a command to find the size of the swap file. (1 Reply)
Discussion started by: paule
1 Replies

2. Shell Programming and Scripting

Finding EOL char is there or not in a big size file

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)
Discussion started by: HariRaju
4 Replies

3. Shell Programming and Scripting

how to know whether that file has eol or noeol before opening that file in VI editor

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)
Discussion started by: HariRaju
1 Replies

4. Solaris

Swap config - Mirror swap or not?

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)
Discussion started by: BG_JrAdmin
3 Replies

5. Shell Programming and Scripting

Lookup value in file and Append new value at EOL

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)
Discussion started by: kixazz2529
4 Replies

6. HP-UX

Swap device file and swap sapce

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)
Discussion started by: lamoul
6 Replies

7. Linux

How to insert EOL?

How can I insert End of line (EOL) in Unix to file. Thanks (5 Replies)
Discussion started by: mrn6430
5 Replies

8. AIX

How to remove ^M from the EOL?

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)
Discussion started by: mrn6430
3 Replies

9. Solaris

Explain the output of swap -s and swap -l

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)
Discussion started by: seenuvasan1985
6 Replies
XdbeSwapBuffers(3)						    X FUNCTIONS 						XdbeSwapBuffers(3)

NAME
XdbeSwapBuffers - swaps front and back DBE buffers. SYNOPSIS
#include <X11/extensions/Xdbe.h> Status XdbeSwapBuffers( Display *dpy, XdbeSwapInfo *swap_info, int num_windows) DESCRIPTION
This function swaps the front and back buffers for a list of windows. The argument num_windows specifies how many windows are to have their buffers swapped; it is the number of elements in the swap_info array. The argument swap_info specifies the information needed per window to do the swap. The XdbeSwapInfo structure has the following fields: Window swap_window XdbeSwapAction swap_action swap_window specifies the window for which to swap buffers. swap_action specifies the swap action to use for this swap_window. swap_action determines what will happen to the new back buffer of the swap_window it is paired with in the list in addition to making the old back buffer become visible. The defined actions are as follows: XdbeUndefined The contents of the new back buffer become undefined. This may be the most efficient action since it allows the implementation to discard the contents of the buffer if it needs to. XdbeBackground The unobscured region of the new back buffer will be tiled with the window background. The background action allows devices to use a fast clear capability during a swap. XdbeUntouched The unobscured region of the new back buffer will be unmodified by the swap. XdbeCopied The unobscured region of the new back buffer will be the contents of the old back buffer ERRORS
BadMatch A non-double-buffered window was specified or a window was specified twice. BadWindow An invalid window was specified. BadValue An invalid swap action was specified. SEE ALSO
DBE, XdbeAllocateBackBufferName(), XdbeBeginIdiom(), XdbeDeallocateBackBufferName(), XdbeEndIdiom(), XdbeFreeVisualInfo(), XdbeGetBack- BufferAttributes(), XdbeGetVisualInfo(), XdbeQueryExtension(). X Version 11 libXext 1.0.5 XdbeSwapBuffers(3)
All times are GMT -4. The time now is 06:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy