List of FTP Commands For Linux and Windows with Examples

FTP protocol and tools are used to transfer data over network in a simple manner. There are different FTP tools with GUI support which can provide simple usage without knowing any command but in some cases we may need to use FTP commands. In this tutorial we will learn how to use FTP commands with example in operating systems like Windows and Linux.

Escape Shell

!

Execute Macro

Defined macros can be executed with the $ by providing the macro name. In this example we will run macro named test

$test

Print Local Help Information

We can print help information about local commands with ?

?
Print Local Help Information
Print Local Help Information

Send Account Command To Remote Server

After connecting an FTP server we can change the current user with account command. This will as for the USER and PASS information.

account

Append To A File

We can append into existing file with append command like below.

append

Set ASCII Transfer Type

There are different transfer types. We can use ascii to change text transfer mode.

ascii

Beep When Command Completed

beep command will play sound after the given command is completed.

beep

Set Binary Transfer Type

Other than ascii type there is also binary transfer type where there will be no translation during transfer.

binary

Terminate FTP Session and Exit

We can terminate current FTP session and exit from FTP shell with bye command like below.

Terminate FTP Session and Exit
Terminate FTP Session and Exit
bye

Toggle Case Sensitivity

Case sensitivity can be enabled or disabled with case command like below.

case

Change Remote Working Directory

We can change current working directory of the remote system or server with the cd command. In this example we will navigate to the remote directory Mirror

cd Mirror
Change Remote Working Directory
Change Remote Working Directory

Change Remote Directory To Parent Directory

cdup will automatically change current working directory of remote system to the parent or single upper level.

cdup

Change Remote File Permissions

If we have enough privileges we can change remote system file permissions iwth chmod like in Linux systems.

chmod

Terminate FTP Session

Another command to terminate FTP sessions but this command will not exit from interactive FTP shell.

close
Terminate FTP Session
Terminate FTP Session

Enable/Disable Carriage Return Stripping

cr

Enable/Disable Debugging

If we have problem about executing commands we may need more information. We can run commands in verbose mode with debug command.

debug
Enable/Disable Debugging
Enable/Disable Debugging

Delete Remote File

We can delete remote file with delete command. In this exmaple we will delete file named old.txt

delete old.txt

List Contents of Remote Directory

We can list contents , files and folders of the remote system with the dir command like below.

$ dir
List Contents of Remote Directory
List Contents of Remote Directory

Terminate FTP Session

We can close current FTP session or connection but stay in the FTP shell with disconnect command.

disconnect
Terminate FTP Session
Terminate FTP Session

Terminate FTP Session and Exit

We can terminate current FTP session and exit from FTP shell with exit command.

exit
Terminate FTP Session and Exit
Terminate FTP Session and Exit

Set File Transfer Format

form

Receive File

We can download from remote system with get command. We will download file named timestamp.txt in this example.

get timestamp.txt
Receive File
Receive File

Display Local Help Information

help
Display Local Help Information
Display Local Help Information

Set Binary Transfer Type

image

Allow Use Of Any IP Address Family

ipany

Resctrict Only IPv4

ipv4

Restrict Only IPv6

ipv6

Change Local Working Directory

As we work also local system we can change local directory with lcd command.

lcd Downloads/
Change Local Working Directory
Change Local Working Directory

List Contents Of Remote Directory

The one of the most popular FTP command is ls which will list contents, files, folders of the remote system.

ls
List Contents Of Remote Directory
List Contents Of Remote Directory

Define Macro

macdef

Delete Multiple Files

We can delete multiple files and folders with a single command. In this example we will delete files named 1.txt , 2.txt , 3.txt

mdelete 1.txt 2.txt 3.txt

Create Directory On Remote

We can create a directory on the remote system with mkdir command. In this example we will create directory named backup

mkdir backup

List Contents Of Multiple Remote Directories

mls

Set File Transfer Mode

mode

Show Last Modification Time Of Remote File

We can show last modification time of the file on the remote system with modtime command. We will list modification time of the  filelist.gz on the remote system.

modtime filelist.gz
Show Last Modification Time Of Remote File
Show Last Modification Time Of Remote File

Send Multiple Files

We can put multiple files with mput command. In this example we will send files 1.txt , 2.txt , 3.txt

mput

Get File If Remote File Is Newer Than Local File

We can only get file if remote file is newer then local file. In this example we check remote file 1.txt with local file 1.txt

newer 1.txt 1.txt

List Contents Of Remote Directory

nlist

Set Template For default File Name Mapping

nmap

Set Translation Table For Default File Name Mapping

ntrans

Connect Remote FTP Server and Port

We can connect to the FTP server with open command from FTP shell. In this example we will connect to the ftp.itu.edu.tr .

open ftp.itu.edu.tr
Connect Remote FTP Server and Port
Connect Remote FTP Server and Port

Enter Passive Transfer Mode

passive

Force Interactive Prompting on Multiple Commands

prompt

Issue Command On Alternate Connection

proxy

Send Single File

We can use put command in order to send single file to the FTP server. In this example we will send file named data.txt to the remote system.

put data.txt

Print Working Directory on Remote System

We can print and list current working directory of the remote system or server. We will use pwd without any option.

pwd
Print Working Directory on Remote System
Print Working Directory on Remote System

Print ? In Place Of Control Characters

qc

Terminate FTP Session and Exit

Another good command in order to terminate FTP session and exit from FTP shell.

quit
Terminate FTP Session and Exit
Terminate FTP Session and Exit

Send Arbitrary FTP Command

quote

Receive File

Another good command in order to download file from remote FTP server we will use recv command with the file name we want to download. In this example we will download file named timestamp.txt .

recv timestamp.txt
Receive File
Receive File

Get File Restarting At End Of Local File

reget

Rename File

We can rename a remote file. We will use rename with the current name of file and new name of the file. We will rename file named data.txt into newdata.txt

rename data.txt newdata.txt

Clear Queued Command Replies

reset

Restart File Transfer At Byte Count

restart

Get Help From Remote Server

rhelp

Remove Directory On Remote System

We can remote a directory on the remote FTP server or system with rmdir by providing the directory name. In this example we will remove directory named old

rmdir old

Show Status Of Remote System

After connecting remote FTP server or system we can print current status about the remote system and connection with the rstatus command.

rstatus
Show Status Of Remote System
Show Status Of Remote System

We can see that there are following information

  • Connected IP address
  • Mode or Type which is ASCII in this case
  • Sessions bandwith limit which is unlimited in this example
  • Sessions timeout which is 300 seconds in this example
  • Control connection type which is plain text in this example
  • Data connection type which is plain text in this example
  • Connected client count to the remote FTP server which is 2 in this example
  • Server software name and version with its banner which is vsFTPd 2.2.2 in this example

Toggle Store Unique for Local File

runique

Send One file

We can send a single file to the remote server with the send command by specifying file name. In this example we will send file named data.txt

send data.txt

Enable/Disable Use Of PORT For Each Data Connection

sendport

Show Size Of Remote File

We can print the size of the given file on the remote server with size command and providing the file name. In this example we will print the size of the filelist.gz

size filelist.gz
Show Size Of Remote File
Show Size Of Remote File

Show Current Status

We can print current status of the connection and technical details with status command.

status
Show Current Status
Show Current Status

Set File Transfer Structure

struct

Toggle Store Unique On Remote System

sunique

Show Remote System Type

While working with remote FTP server operating system is important. We can get information about remote system with system command like below.

system
Show Remote System Type
Show Remote System Type

Set Tenex File Transfer Type

tenex

Enable/Disable Printing Byte Counter During Transfers

tick

Enable/Disable Package Tracing

trace

Set File Transfer Type

type

Get Umask On Remote System

umask

Send New User Information

We can relogin with different user name by using user command. We will provide user name and password interactively.

user
Send New User Information
Send New User Information

Enable/Disable Verbose Mode

Like debug mode with can enable and disable verbose mode with verbose command like below.

verbose
Enable/Disable Verbose Mode
Enable/Disable Verbose Mode

1 thought on “List of FTP Commands For Linux and Windows with Examples”

Leave a Comment