Page 1 of 1

multiple files moved mistakenly in single file

Posted: Wed May 19, 2010 11:40 am
by abdulsami
Dear All,

while trying to move multiples files from one location document, multiple files moved into single file due to typing error in directory name. like,

mv file1 file2 file3 mydr

here mistakenly user written mydr instead of mydir and resultantly files moved to mydr file, and we are stuck in how to recover back them this single file.

Any help in this regard would be highly updated.

Regards,

Posted: Wed May 19, 2010 12:53 pm
by lambda
how did that happen? when i try it, it doesn't work:

Code: Select all

$ echo a > a
$ echo b > b
$ echo c > c
$ mkdir t
$ mv a b c d
mv: target `d' is not a directory
$ ls -l a b c d
ls: cannot access d: No such file or directory
-rw-r--r-- 1 me me 2 2010-05-19 12:51 a
-rw-r--r-- 1 me me 2 2010-05-19 12:51 b
-rw-r--r-- 1 me me 2 2010-05-19 12:51 c
$
on freebsd:

Code: Select all

$ echo a > a
$ echo b > b
$ echo c > c
$ mkdir t
$ mv a b c d
usage: mv [-f | -i | -n] [-v] source target
       mv [-f | -i | -n] [-v] source ... directory
$