Powered by eUKhost®


No announcement yet.

How to use FTP via Terminal

  • Filter
  • Time
  • Show
Clear All
new posts

  • How to use FTP via Terminal

    To connect to FTP via the Terminal, you need to ensure you have an FTP Account active for your web hosting account. If you have cPanel, you have a default FTP Account which is the same as your cPanel account username.

    To connect to FTP, first use the following command (modifying to your own username and domain name, obviously):

    ftp username@domainname.com
    Then enter the password required so you are able to upload and download files via the FTP connection. You won't see your password as you type it - just press the Enter key once you've finished typing your password.

    Now you're connected to FTP, you can use commands such as get and put in order to download and upload files via FTP, respectively. Other commands include:

    get command:
    get remote_file local_file

    put command:
    put local_file remote_file

    In this case, local_file means the local file name and needs to be replaced with the name of that local file name and extension (i.e., index.html as an example). Conversely, remote_file means the file located on the server, and needs to be replaced with the name of that remote file name and extension as well.

    The get command would be used to download a file from the server, and the put command would be used to upload a file to the server. You would need to edit the files locally on your machine and then make sure the file is saved to the directory the Terminal window was in before connecting to FTP, then use the put command to upload it. You can use the vim text editor in order to edit files locally via the Terminal; however you would still need to download the file first, and then re-upload the file afterwards on each file modification. The vim text editor is installed on most Linux distributions out there including Ubuntu, as well as the Unix-based Mac OS X operating system.

    Other basic commands to get you going (these are also used in normal Terminal use):

    Change directory:
    cd folder_name

    To go back a directory, use cd ../

    Make directory:
    mkdir dir_name

    List current files and folders in active directory:
    (that's LS - not IS)

    To exit FTP (and Terminal if you used it again):

    There's a page on FTP Terminal commands on the about.com website here: ftp - Linux Command - Unix Command
    Find us on Twitter and Facebook

    Need to contact us?
    Customer Support: Client Area - 0800 862 0380 (option 2)
    Customer Relations: feedback@eukhost.com - 0800 862 0380 (option 3)
    Sales: sales@eukhost.com - 0800 862 0380 (option 1)

    The opinions or views expressed above are not necessarily the opinions or views of eUKhost Ltd.