Moving Files via SSH

Discussion in 'Site & Server Administration' started by EnDLeSs_27, Jan 16, 2009.

  1. #1
    So I have a bunch of files under one username in cpanel/whm. I am trying to move all the files to another username on the same server. Anyone know of an SSH command or easy way this can be done?
     
    EnDLeSs_27, Jan 16, 2009 IP
  2. blowingideas

    blowingideas Peon

    Messages:
    642
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    cp -rf /_directory_name_ /_path_of_another_username/
     
    blowingideas, Jan 16, 2009 IP
  3. EnDLeSs_27

    EnDLeSs_27 Active Member

    Messages:
    112
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    #3
    Doesn't the cp command just copy the files rather then moving them?
     
    EnDLeSs_27, Jan 17, 2009 IP
  4. mortenb

    mortenb Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    mv /path/to/original/folder /path/to/new/folder

    the mv (move) command can do what you want
     
    mortenb, Jan 17, 2009 IP
  5. maestria

    maestria Well-Known Member

    Messages:
    705
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    110
    #5
    You have to verify if the files at the new location has the required user permissions.
    Most probably it will be under the ownership of root.
    You need to explicitly change that using the chown command
     
    maestria, Jan 18, 2009 IP
  6. thegetpr

    thegetpr Banned

    Messages:
    99
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    in whm there is a option to change user account name.
    thn u can move your files anywhere in your server
     
    thegetpr, Jan 20, 2009 IP
  7. fava

    fava Peon

    Messages:
    26
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Well since you are on the same server you dont need ssh.

    If you were sending to different servers the command to use is scp, which is part of the ssh package.

    scp /from/file/list tohostname:/to/directory/name/.

    fava
     
    fava, Jan 20, 2009 IP
  8. thegetpr

    thegetpr Banned

    Messages:
    99
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    if you are really newbie and dont know anything then use
    sftpdrive.exe it will work just like you are using windows,

    http://www.expandrive.com/sftpdrive

    else if u want to do with ssh then

    use coomand

    locate (username of that site ) suppose endless is username
    locate endless

    chk the path
    it might be something like this

    /home/endless/
    then use command to copy

    cp /home/endless/ /address of new location./ / /

    hope you understand

    if u have any problem contact me
     
    thegetpr, Jan 20, 2009 IP
  9. kriskd

    kriskd Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    How would I move not only the files in the directory, but all the sub-directories as well? I used the mv command and it moved the files only, but not the sub-directories.
     
    kriskd, Jan 20, 2009 IP
  10. fava

    fava Peon

    Messages:
    26
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #10
    The mv command is not recursive. The cp command and the rm is so:
    cp -r /from /to
    rm -r /from

    Should take care of it

    fava
     
    fava, Jan 21, 2009 IP