Table of Contents
ToC

ToC3. Command-line file transfer

The standard command-line form of SFTP and SCP programs is where you type commands line by line. This is not as pretty as a windowing system but it's faster and simpler. You can also install graphical systems such as FireFTP (in Firefox), gFTP, or FileZilla (see [reference to element type "" has not been provided for]).

Up to start of section3.1. Command-line access under Windows

[awaiting information]

Up to start of section3.2. Command-line access on Unix-like systems (Linux and Apple Mac OS X)

Up to start of subsection3.2.1. Making a connection

Standard command-line SFTP needs no setting up: you just type at the command prompt

$ sftp username@host.site.domain

replacing username with your username on the remote system, and host.site.domain with the name of that system.

The first time you ever connect to a site, it will ask you if it is OK to accept the authenticity of the site. Answer yes (assuming that you are indeed certain that it's where you want to go!).

The program now connects to the remote site and will ask you to log in.

Up to start of subsection3.2.2. Logging in

Logging in means providing the password that goes with your username.

The remote site will prompt for your username: type it in and press Enter.

Connecting to www.ucc.ie...
username@www.ucc.ie's password:       

(It will not display anything, for security reasons.) You will be logged in and get the SFTP prompt which means the system is ready to accept your commands:

sftp>

Up to start of subsection3.2.3. Transferring files

To send a file from your current (local) directory to the server (into its current directory) type

put filename

To get a file from the server's current directory into your current local directory, type

get filename

More commonly, however, you first need to go to the right directory…

Up to start of subsection3.2.4. Finding your way around (navigating)

To see a list of files and folders in the current server directory, type  ls -l  , for example:

sftp> ls -l 
dr-xr-xr-x   2 ontology  system    512 Nov 21 01:07 bin 
drwxr-xr-x   2 ontology  webster   512 Nov 23 10:47 web
sftp>

To change directory on the server, type

cd directoryname

Subdirectories (folders) are indicated with a letter d in the first character position on the line. If you lose track of where you are, type  pwd  to show the current working directory on the server. To go back up to the previous directory level, type cd .. (that's two dots).

To see a list of files in your local (PC) directory, use the  lls -l   command. To change local directory, use  lcd directoryname , and to see what local directory you are in, use  lpwd

Up to start of subsection3.2.5. Finishing up

You have to wait while the file transfer you have requested finish. When it is done, you will see the sftp> prompt again, and you can send or retrieve another file, change directory again, or log off. To log off, just type  quit

Table of Contents
ToC
RSS newsfeedKeep up to date with our RSS newsfeed