1

I was trying to move files from one dir to another and I missed up my home director can someone help me undo this script. everything in my home dir now put in dir called myfiles. I am on Ubuntu 20.04

mv ~/my_files/master_cs/jv/foundation_cls/ -v !("~/my_files/master_cs/jv/foundation_cls/cop_5007") ~/my_files/master_cs/jv/foundation_cls/code_snipt

1 Answer 1

2

If I am getting your question right then you can simply move back directories to home folder by opening your teriminal and doing this:

cd ~/my_files
mv * ../
6
  • this did not solve the problem now everything in my_files is in /home/user and still unable to access system dir like Document and all those files/ dirs in the home/user can not find them ``` customized-script IdeaProjects Pictures snap Desktop MOK.der playground1 Templates Documents MOK.priv playground2 Vagrantfile Downloads Music play_sh Videos eclipse my_files Public 'VirtualBox VMs' eclipse-workspace online_projects shellclass ```
    – Rick
    Sep 25, 2021 at 7:31
  • How I can move back everything from home dir to my_files which is also now in my home dir? I think I know how to fixed if I can return back to the previous state?
    – Rick
    Sep 25, 2021 at 7:41
  • I’m not sure why the suggested answer didn’t work. I wonder if you might find this easiest to do via the gui? Go into the folder you accidentally moved everything, make sure you can see hidden files, select everything with the mouse, right-click and cut-and-paste into the home folder. I think (someone correct me if I’m wrong) it should be near-instantaneous because nothing actually has to move if the things you’re moving are in a sub-folder.
    – Will
    Sep 25, 2021 at 9:56
  • 1
    @Will the suggested answer worked but in that panic mood I forget to do `` mv * `` so I can move everything from the files to the home directory. Now things work just fine. I just check the hidden file still in home. And thanks @vanaium
    – Rick
    Sep 25, 2021 at 18:01
  • 1
    Thanks for posting back that you’ve sorted it - lesson for us all that doing anything on the command line in a panic is a bad idea! Well done for fixing it.
    – Will
    Sep 25, 2021 at 18:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .