During the course of some testing, I ran the bast scriptfor file in *; do    mv -v $file $file#_*doneor 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.
Recover files after moving directory names?
shell;data recovery
I'm not totally sure what you did there, but if the command in your question is the one you ran, you should just be able to reverse it:for f in *do echo mv -v $f ${f%#_*}donePlease don't remove the echo from that command until you're sure it works, but, just to explain why I think it will, here's what I did:for f in $(seq 100)do echo $f > file$fdoneThat made me 100 files like file1 - file100 and each one contained its number, so:$ cat file100100Like that. Then I did your thing:for f in *do mv -v $f $f#_*doneAnd I had a bunch of files like file1#_* - file100#_*. Then I did my thing pasted in the first codeblock here, but without the echo and I did...$ cat file100100