This forum is in archive mode. You will not be able to post new content.

Author Topic: mv command accidental merge ...can it be undone?  (Read 544 times)

0 Members and 1 Guest are viewing this topic.

Offline DerpyTurtle

  • Peasant
  • *
  • Posts: 80
  • Cookies: -12
    • View Profile
mv command accidental merge ...can it be undone?
« on: September 09, 2015, 03:27:51 AM »
So I went to move a bunch of files from my main machine to my external drive and I ended up using this command

Code: [Select]
# mv *.mp3 /foler1/folder2/folder3/filename
and when the command completed I realized that I made a mistake because the directory I was trying to move these files to was actually one step higher so the command should have been this

Code: [Select]
# mv *.mp3 /folder1/folder/2/folder3/

My question to you is there any way to remedy this? Any way to go back and retrieve those files after they were all accidentally merged into a single file instead of a directory..? I have been living in Windows land for the past few years because of work so my skills are a little rusty. Any help is much appreciated[/code]
« Last Edit: September 09, 2015, 03:28:35 AM by DerpyTurtle »

Offline 0E 800

  • Not a VIP
  • VIP
  • Baron
  • *
  • Posts: 895
  • Cookies: 131
  • • тнε ιηтεяηεт ιs мү яεcүcℓε-вιη •
    • View Profile
Re: mv command accidental merge ...can it be undone?
« Reply #1 on: September 09, 2015, 05:46:39 AM »
filename is not a directory. i dont think it would let you complete the command.

trick question?
« Last Edit: September 09, 2015, 05:52:04 AM by 0E 800 »
The invariable mark of wisdom is to see the miraculous in the common.

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: mv command accidental merge ...can it be undone?
« Reply #2 on: September 09, 2015, 07:23:07 AM »
Even if that let you merge files, I have no idea how it'd be possible to unmerge them. However tho, every file name has a beginning and an end which is marked by file type header. You could make a raw byte parsing tool which would read bytes from that merged file and write blocks of MP3 data into separate files :P

Offline gray-fox

  • Knight
  • **
  • Posts: 208
  • Cookies: 52
    • View Profile
Re: mv command accidental merge ...can it be undone?
« Reply #3 on: September 09, 2015, 08:07:20 AM »
It's possible, even tho I would say "merged" isn't exactly right word. If you had only one .mp3 file in your current directory. Then you just basically did,
Code: [Select]
mv file1.mp3 file2
and file2's content gets "overwritten" by file1.mp3's content. But if you had multiple .mp3's as I would imagine because the use of wildcard, then it should complain about file2 not being directory as OE 800 said.

edit: Just realized op said bunch of files, so trick question+1?

Also @DerpyTurtle, did you somehow examine the output file to see that it actually changed. E.g.
Code: [Select]
$ file filename #if target file wasn't originally mp3
$ stat filename
« Last Edit: September 09, 2015, 09:06:18 AM by gray-fox »

 



Want to be here? Contact Ande, Factionwars or Kulverstukas on the forum or at IRC.