ftp is an network protocol that handle transfer data between computer and use client server architecture. Usually many people connect ftp with interface system like filezila, windows exploler interface, etc. But sometime as a network administrator we have to use terminal for it, it means that we have to understand the ftp command line. So in this lesson we will learn about ftp command line. This the list of ftp command
bye
|
Disconnect from ftp
|
cd
|
Change directory in remote host
|
delete
|
delete a file in remote host
|
dir
|
to list all files in the current remote directory
|
get
|
to copy a file from the remote host to the local host
|
help
|
to get a list of all FTP commands
|
lcd
|
to change directory on your local host
|
mdel
|
Delete multiple files from remote host
|
mget
|
to copy multiple files from the remote host to the local host;
|
mkdir
|
to make a new directory in the remote directory
|
mput
|
to copy multiple files from the local host to the remote host;
|
prompt
|
Turn off or on interactive mode
|
put
|
to copy a file from the local host to the remote host
|
pwd
|
to find out the pathname of the current directory on the remote host
|
rmdir
|
to to remove directory in the remote host
|
This is some example how to use ftp command on cmd or
terminal.
1. First if you want to connect ftp via terminal use
#
ftp ftphostname.com
ftphostname.com will be your domain name or ip address of your ftp server.
2. To show your current directory on your remote host use
#
pwd
3, To
list file of current directory in remote host use
#
dir
4. To create
and remove directory use
#
mkdir directory-name
#
rmdir directory-name
5. Change directory
#
cd direcoty-name
#
cd ..
6. Get, send and delete file from ftp
#
get file-name.txt
#
put file-name.txt
#
del file-name.txt
7. Get, send and delete multiple file from ftp
#
mget file1.txt file2.txt
#
mput file1.txt file2.txt
#
mdel file1.txt file2.txt
8. You can
use mget, mput, and mdel for get, send or delete multiple file for spesific
extension
#
mget *.rar
#
mput *.rar
#
mdel *.rar
9. When
use command mget, mput, mdel you have to confirm each file first before the
file being executed. If you want to pass the confirmation, you can use
# prompt off
if you want to turn on use
# prompt on
10. Show current
local directory of your local host.
# lcd
11. Change
your directory with lcd command
#
lcd mydirectory
#
lcd ..
12. Interact
with your local shell command with “!”. So if you want to list file in current
local directory of your local host use:
# !dir
or
# !ls
you can change your current directory of your local host with
#
!cd directory-name
The
“!” character is used for run local shell command, So if you need run your
local shell in ftp mode, you can use “!” character.