Background:

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?

Any help greatly appreciated.

Files:

Sorry for the long list

0 1 10 10:1 10:125 10:126 10:127 10:130 10:183 10:224 10:228 10:229 10:231 … 116:8 116:9 … 13:81 … 8 81:0 81:1 81:2 81:3 9 arch_status attr autogroup by-diskseq by-id by-label by-partlabel by-partuuid by-path by-uuid cgroup cmdline comm coredump_filter cpu_resctrl_groups cpuset fd fdinfo fonts gid_map grubenv limits list.txt locale loginuid map_files maps mountinfo mounts net ns numa_maps nvme0n1p8_crypt oom_adj oom_score oom_score_adj projid_map sched schedstat sessionid setgroups smaps smaps_rollup stat statm status task timens_offsets timers timerslack_ns uid_map unicode.pf2 usb wchan x86_64-efi

  • oshu@lemmy.world
    link
    fedilink
    arrow-up
    13
    ·
    12 hours ago

    If you ran this as a non-root user then you didn’t move any system files you just made some copies. Delete the new copies and you should be fine.

    • Joël de Bruijn@lemmy.mlOP
      link
      fedilink
      arrow-up
      5
      ·
      12 hours ago

      Got chills down my spine initially but was a “good” scare … the one which makes me carefull next time before any real damage is done. 🙈👍

  • Quazatron@lemmy.world
    link
    fedilink
    arrow-up
    10
    ·
    16 hours ago

    Mark it as an achievement on your learning path and move on. We all did something silly like that at some point.

    Great that you have backups, get a fresh install and restore it.

    Lessons learned: don’t work as root unless you absolutely positively have a good reason to do so.

    • pewpew@feddit.it
      link
      fedilink
      arrow-up
      4
      ·
      15 hours ago

      I have the habit of holding shift everytime I delete something, one day I’ll learn the hard way not to do it

    • Joël de Bruijn@lemmy.mlOP
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      16 hours ago

      I only have a backup of my own personal files, not of the whole system. So my question about impact is about not having to do a fresh install.

      Also I have dual boot and grub etc do scare me. 😁

      I didnt work as root by the way …

      • Quazatron@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        11 hours ago

        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.

        • Joël de Bruijn@lemmy.mlOP
          link
          fedilink
          arrow-up
          2
          ·
          10 hours ago

          Yeah agree, its a work provided laptop, they allowed local admin etc but require Windows (at least that is) so just glad they gave me a HP laptop with 500GB SSD and for me certain freedom to configure dual boot etc

  • merthyr1831@lemmy.ml
    link
    fedilink
    English
    arrow-up
    6
    ·
    14 hours ago

    I’d probably do a clean install (eventually) even if it looked like stuff works for now.

    I know the pain, though. did rm -rf in the wrong directory and wiped half my drive in seconds. Good times.

  • gonzo-rand19@moist.catsweat.com
    link
    fedilink
    arrow-up
    5
    ·
    14 hours ago

    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.

    • Joël de Bruijn@lemmy.mlOP
      link
      fedilink
      arrow-up
      4
      ·
      edit-2
      13 hours ago

      If the actual command was this … mv /*/*/* ./ would moving stuff out of /boot or /dev folders make more sense?

      • gonzo-rand19@moist.catsweat.com
        link
        fedilink
        arrow-up
        3
        ·
        11 hours ago

        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.

      • Joël de Bruijn@lemmy.mlOP
        link
        fedilink
        arrow-up
        2
        ·
        13 hours ago

        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).

  • Joël de Bruijn@lemmy.mlOP
    link
    fedilink
    arrow-up
    3
    ·
    13 hours ago

    I took a deep breath (was not being root, how bad could it be?) and rebooted. Luckily everything seemed fine.

    Grub letting me choose between Debian and Win11 (its a laptop from my employer) and both booted if choosen. Thanks for all the advice.

  • dengtav@lemmy.ml
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    17 hours ago

    I think there is a typo in the path in the body of your post, or?

  • ascense@lemm.ee
    link
    fedilink
    arrow-up
    1
    ·
    14 hours ago

    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.