Skip to main content
added 212 characters in body
Source Link
Nick
  • 15
  • 1
  • 5

During the course of some testing, I ran the bast script

for file in *; do mv -v "$file" "$file#_*" done 

or something along those lines. The plan was to remove a prefix from directory names but I accidentally ran it in my home directory rather than in the test directory I had created...

My understanding is that all of the files inside directories should be "safe" (as in, not deleted), but that I now have no way to access them via a directory structure.

Is there a way to recover these files?

Thanks in advance.

UPDATE It appears my memory was incorrect: the command in the for loop was actually echo mv .... Somehow, all the directories and file in ~ were moved to my Videos directory, but appear to be intact.

During the course of some testing, I ran the bast script

for file in *; do mv -v "$file" "$file#_*" done 

or something along those lines. The plan was to remove a prefix from directory names but I accidentally ran it in my home directory rather than in the test directory I had created...

My understanding is that all of the files inside directories should be "safe" (as in, not deleted), but that I now have no way to access them via a directory structure.

Is there a way to recover these files?

Thanks in advance.

During the course of some testing, I ran the bast script

for file in *; do mv -v "$file" "$file#_*" done 

or something along those lines. The plan was to remove a prefix from directory names but I accidentally ran it in my home directory rather than in the test directory I had created...

My understanding is that all of the files inside directories should be "safe" (as in, not deleted), but that I now have no way to access them via a directory structure.

Is there a way to recover these files?

Thanks in advance.

UPDATE It appears my memory was incorrect: the command in the for loop was actually echo mv .... Somehow, all the directories and file in ~ were moved to my Videos directory, but appear to be intact.

edited tags
Link
mikeserv
  • 59.4k
  • 10
  • 123
  • 243
Source Link
Nick
  • 15
  • 1
  • 5

Recover files after moving directory names?

During the course of some testing, I ran the bast script

for file in *; do mv -v "$file" "$file#_*" done 

or something along those lines. The plan was to remove a prefix from directory names but I accidentally ran it in my home directory rather than in the test directory I had created...

My understanding is that all of the files inside directories should be "safe" (as in, not deleted), but that I now have no way to access them via a directory structure.

Is there a way to recover these files?

Thanks in advance.