FTP Commands, by example. The FTP (File Transfer Protocol) utility program is commonly used for copying files to and from other computers .
To connect to a FTP server : - Code:
ftp <hostname> [port]
Here a list of important FTP commands ? get information about the FTP commands
- Code:
? [command]
ascii - To set the mode to ASCII mode before transferring text files.
- Code:
ascii
binary - Sets the type of transfer to binary
- Code:
binary
bye exit FTP environment
- Code:
bye
cd to change from directory to another
- Code:
cd remote-directory
close close the current connection
- Code:
close
delete [remote-file] to delete a file in the current remote directory
- Code:
delete remote-file
dir list of a remote directory's files and subdirectories
- Code:
dir [remote-directory] [local-file]
get - Copies a single file from the remote computer to the local computer
- Code:
get remote-file [local-file]
help [command ] Displays descriptions for ftp commands
- Code:
help [command]
lcd [directory ] Changes the working directory of the local machine
- Code:
lcd [directory]
pwd -Show the current directory on the remote computer
- Code:
pwd
lpwd Show the current directory on the local computer
- Code:
lpwd
ls [remote-directory ] [local-file ] to list the names of the files in the current remote directory
- Code:
ls [remote-directory] [local-file]
mget to copy multiple files to the local computer from remote computer.
- Code:
mget remote-files [ ...]
mput to copy multiple files to the remote computer from local computer.
- Code:
mput local-files [ ...]
put to copy one file to the remote computer from the local machine.
- Code:
put local-file [remote-file]
open hostname - connects to the specified host.
- Code:
open computer [port]
quit Ends the FTP session with the remote computer and exits ftp it is the same effect like
- Code:
quit
quote Sends arguments, verbatim, to the remote FTP server
- Code:
quote argument [ ....]
mkdir Creates a remote directory on the remote computer
- Code:
mkdir directory
mls Displays an abbreviated list of a remote directory's on the remote computer
- Code:
mls remote-files [ ...] local-file
rename Renames remote files on the remote computer
- Code:
rename [filename] [new filename]
rmdir Deletes a remote directory on the remote computer
- Code:
rmdir [directory]
send Copies a local file to the remote computer
- Code:
send local-file [remote-file]
status Displays the current status of FTP connections
- Code:
status
trace Toggles packet tracing
- Code:
trace
type Sets the mode to the transfer mode
- Code:
type [type-name]
user Authentication username
- Code:
user user-name [password] [account]