I think I messed up ...
Wanted to get a lot of files out of a nested folderstructure 3 levels deep and used mv /*/*/* ./ somewhere deep in my personal folders.
I got a lot of errors and quick as I could stopped it.
Now that folder is is messed up with a lot of stuff (see below) which I dont know the origin of.
The good news: I have fairly recent backups
Questions:
Could they be from subdirectories in my home folder?
Could they be from subdirectories outside my home folder? Especially grubenv caught my eye.
Could it be potentially dangerous to reboot? I leave my PC on untill I know more.
Would it be possible to reverse the moving in some way, to put them back where they belong, even manually?
Good thing everything is now fine.
For the next time You use 'mv' or 'cp' or 'rm' and so on, replace this with ls to see what files abd folders You are about to move, remove, copy
I always treat the system as discardable and only backup the /home and /etc directories. Saving those, I can afford to wipe the system and re-settle on a new distro if I want to.
Of course if you throw Windows into the mix, all bets are off. Personally, I stay the hell away from that.
Classic. I also did the rm -rf once in a wrong directory of a programming project. Luckily it was a subdirectory, so nothing important lost. But it could have easily if I was one hierarchy higher.
I am so much afraid of rm -rf, that I usually go in a directory with cd and rm in current directory those files only. And then I do rmdir on empty directories. I use recursive -r only, with specific directory names included (autocomplete helps). This way, even if I am in the wrong directory, the chance that there is the exact same directory name is a bit lower.
And I often also just switch to graphical filemanager to delete files. Not only that. Sometimes I also just move folder instead deleting, so I have a back up until I'm sure. There is also trash-cli.
If ./ and ./*/*/* are both within your home folder, you should just restore it from your backup. The command you ran takes everything up to 3 levels deep and moves it up to the working directory, and unraveling that will be a pain in the ass.
I can't say because those paths are relative and I don't know your file structure. That said, even if I did, restoring from backup would take out all of the guesswork here so I would recommend that over trying to do it manually.
Strange thing is, instead of moving folders (which isnt possible without root anyway) it looked like some of them got copied instead. Compared some folders from /boot/grub with the dump in my homefolder and they were the same files (number and names etc).
Unless you ran the command as root, on a standard install it should really only be able to touch your home directory and any disks you may have had user mounted under /media.