MLUG: Re: [MLUG] Re: recover files
Re: [MLUG] Re: recover files
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
On Fri, 11 Aug 2006, Shawn Parker wrote:

nm. the files were only log files. nothing important.

On 8/11/06, Shawn Parker <EMAIL:PROTECTED> wrote:
i have a user who moved a list of files into a file instead of a
directory. only the first file actually transferred. is there an easy
way to recover the rest of the missing files?


If they moved a list of files, why did only the first file transfer?

If they did something like this...

cat files* > newfile
rm files*

Then all the "files" are in newfile. If you don't know how long they are, it could be tricky, but if you can find the line numbers where each one begins, it is easy to use tail and head together to extract the original files. Suppose there were four files ("files[1-4]") and the second, third and fourth files begin on lines 153, 846 and 1204, respectively, of the newfile. Then do this:

head -152 newfile > files1
head -845 newfile | tail +153 > files2
head -1203 newfile | tail +846 > files3
tail +1204 newfile > files4

There can be millions of lines - no problem. If there are many files, it will take a long time to figure out where they begin and end unless you can automate that somehow. If you can come up with a long list of line numbers, it is easy to make a script to write out the code I have above.

Mike

_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members