Sponsored Content
Top Forums Shell Programming and Scripting How to Undo overwrite file in UNIX? Post 302886847 by mail.chiranjit on Tuesday 4th of February 2014 02:57:27 AM
Old 02-04-2014
How to Undo overwrite file in UNIX?

Hi,

Could anyone please advise if its possible in unix to undo the changes for a file that has been overwrriten.
By mistake i have overwritten a file and now i need the original file, is there a way?

Please Help!!!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

overwrite specific lines in a file

Hi all, I am trying to overwrite some lines of a very big file. I know the number of the line but I don't know how to point the cursor on its beginning. there is an option to notice the offset in lines? thanks! (7 Replies)
Discussion started by: csecnarf
7 Replies

2. UNIX Desktop Questions & Answers

shell overwrite lines in a file

Hello, I have an external file (file.txt). This shall be a kind of a config file for my shell script. I get the line numbers as to a corresponding entry by grep. Now I would like to substitute the corresponding line from the shell script back to the file and exactly on the same line number. ... (4 Replies)
Discussion started by: ACTGADE
4 Replies

3. UNIX for Dummies Questions & Answers

Restrict file overwrite through FTP

How can I restrict a user from overwriting a file once he has uploaded it through FTP. He can view the file but can't delete or overwrite it. (OS is UNIX, there is no restriction on client FTP software) Will be very glad if someone could resolve this problem. Thanks Imran Aziz Khan ... (7 Replies)
Discussion started by: imranak7
7 Replies

4. Shell Programming and Scripting

Unable to overwrite but can delete file

I'm debugging a ksh script written by someone else that does the following: It runs a command and redirects stdout to a file called dberror that already exists using ">". This command fails with the following error: The file access permissions do not allow the specified action. dberror:... (1 Reply)
Discussion started by: savage66
1 Replies

5. Shell Programming and Scripting

Undo in unix

Hi All, Is there any undo option is there in unix same as recycle bin in windows? (5 Replies)
Discussion started by: Jairaj
5 Replies

6. UNIX for Dummies Questions & Answers

overwrite file in multiple folders

I need to update the contents of a file that exists in several hundred folders. I'm on a mac. Can I use Terminal to execute a linux/unix command that will accomplish the overwriting of the file? (2 Replies)
Discussion started by: webguy262
2 Replies

7. Hardware

Undo ntfsclone --overwrite syntax error

ok so I had a dislexic moment, while typing the command ntfsclone --rescue --overwrite --force /dev/sdc3 /dev/sda3 I got the source and destination backwards so now I have a blank sdc3 I tried using gparted -->device -->attemp data rescue and it didn't help. before I screw this partition up anymore... (0 Replies)
Discussion started by: bleufox99
0 Replies

8. Shell Programming and Scripting

Shell script to overwrite a file

Hi Guys, My requirement as follows, i want to write a shell script to display the files of a folder, i export it to a file to mail the file. The problem is the exported file is getting appended every time I run the script. I just want the file to be over written. can anyone suggest?? ... (4 Replies)
Discussion started by: Karthick N
4 Replies

9. Shell Programming and Scripting

Overwrite file every day

Hi Friends, I have written a script to capture system performance every hour and redirected to output file. How to overwrite the file every next day? Thanks Suresh (4 Replies)
Discussion started by: suresh3566
4 Replies

10. Shell Programming and Scripting

Wget download file ( do not overwrite )

Hello all, I want to write auto update script for my embedded device, which can check and download newer version of my program and extract the files on the device. The download center is hosted on remote web server . Script checks the hosted file on web site and if the new version is there... (8 Replies)
Discussion started by: stefki
8 Replies
STG-REPAIR(1)							   StGit Manual 						     STG-REPAIR(1)

NAME
stg-repair - Fix StGit metadata if branch was modified with git commands SYNOPSIS
stg repair DESCRIPTION
If you modify an StGit stack (branch) with some git commands -- such as commit, pull, merge, and rebase -- you will leave the StGit metadata in an inconsistent state. In that situation, you have two options: 1. Use "stg undo" to undo the effect of the git commands. (If you know what you are doing and want more control, "git reset" or similar will work too.) 2. Use "stg repair". This will fix up the StGit metadata to accomodate the modifications to the branch. Specifically, it will do the following: o If you have made regular git commits on top of your stack of StGit patches, "stg repair" makes new StGit patches out of them, preserving their contents. o However, merge commits cannot become patches; if you have committed a merge on top of your stack, "repair" will simply mark all patches below the merge unapplied, since they are no longer reachable. If this is not what you want, use "stg undo" to get rid of the merge and run "stg repair" again. o The applied patches are supposed to be precisely those that are reachable from the branch head. If you have used e.g. "git reset" to move the head, some applied patches may no longer be reachable, and some unapplied patches may have become reachable. "stg repair" will correct the appliedness of such patches. "stg repair" will fix these inconsistencies reliably, so as long as you like what it does, you have no reason to avoid causing them in the first place. For example, you might find it convenient to make commits with a graphical tool and then have "stg repair" make proper patches of the commits. Note If using git commands on the stack was a mistake, running "stg repair" is not what you want. In that case, what you want is option (1) above. STGIT
Part of the StGit suite - see linkman:stg[1] StGit 03/13/2012 STG-REPAIR(1)
All times are GMT -4. The time now is 03:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy