The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SSH mv file wrong command

Discussion in 'General Discussion' started by basketmen, Nov 18, 2015.

  1. basketmen

    basketmen Well-Known Member

    Joined:
    Sep 9, 2010
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    i want to move a file to another directory

    i run the command like this
    i am forget add slash in the start of folder name, its should be /home



    now the file is missing, cant find it anywhere
    the file size is 450mb, i try run this command but still cant find it


    anyone have explanation where is the file currently?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    You created a file named home in the folder you ran the command in. Even though it is named home it is still a tar gzip file.

    find / -name "home" -type f
    this should search for a file named home
     
  4. basketmen

    basketmen Well-Known Member

    Joined:
    Sep 9, 2010
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    in one of client directory, for example /home/client1
    i am planning to move it to /home & use restore from full backup


    ah so the file changed to /home/home folder?

    i can change the folder to file again like this?
     
  5. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    If the file is in the /home/client1 folder then you should find the file in that folder. You would then need to rename it and move it.

    # move to client folder
    cd /home/client1
    # see if file is indeed there
    ls -al home
    # to make sure it is gzip compress file type
    file home
    # you should see something like this
    home: gzip compressed data, from Unix, last modified
    # now you are ready to rename the file
    mv home username.tar.gz
    # I would make sure you see the file now
    ls -al username.tar.gz
    # if so now you can move to /home
    mv username.tar.gz /home

    That should do it.
    Now see if the file is in /home
    ls -al /home/username.tar.gz


    I hope this helps
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page