1# tftp<a name="EN-US_TOPIC_0000001179965861"></a> 2 3- [Command Function](#section15142134573911) 4- [Syntax](#section20958174917394) 5- [Parameters](#section576613532395) 6- [Usage](#section149795134408) 7- [Example](#section148921918114015) 8- [Output](#section7872155631313) 9 10## Command Function<a name="section15142134573911"></a> 11 12Trivial File Transfer Protocol \(TFTP\) is a protocol in the TCP/IP protocol suite for transferring files between clients and servers. TFTP provides simple and low-overhead file transfer services. The port number is 69. 13 14The **tftp** command is used to transfer files with a TFTP server. 15 16## Syntax<a name="section20958174917394"></a> 17 18./bin/tftp _<-g/-p\>_ _-l_ _\[FullPathLocalFile\] -r \[RemoteFile\] \[Host\]_ 19 20## Parameters<a name="section576613532395"></a> 21 22**Table 1** Parameter description 23 24<a name="table2894mcpsimp"></a> 25<table><thead align="left"><tr id="row2900mcpsimp"><th class="cellrowborder" valign="top" width="20.79%" id="mcps1.2.4.1.1"><p id="p2902mcpsimp"><a name="p2902mcpsimp"></a><a name="p2902mcpsimp"></a><strong id="b116998706011737"><a name="b116998706011737"></a><a name="b116998706011737"></a>Parameter</strong></p> 26</th> 27<th class="cellrowborder" valign="top" width="52.480000000000004%" id="mcps1.2.4.1.2"><p id="p2904mcpsimp"><a name="p2904mcpsimp"></a><a name="p2904mcpsimp"></a><strong id="b13511135745719"><a name="b13511135745719"></a><a name="b13511135745719"></a>Description</strong></p> 28</th> 29<th class="cellrowborder" valign="top" width="26.729999999999997%" id="mcps1.2.4.1.3"><p id="p2906mcpsimp"><a name="p2906mcpsimp"></a><a name="p2906mcpsimp"></a><strong id="b174218805911737"><a name="b174218805911737"></a><a name="b174218805911737"></a>Value Range</strong></p> 30</th> 31</tr> 32</thead> 33<tbody><tr id="row2907mcpsimp"><td class="cellrowborder" valign="top" width="20.79%" headers="mcps1.2.4.1.1 "><p id="p2909mcpsimp"><a name="p2909mcpsimp"></a><a name="p2909mcpsimp"></a>-g/-p</p> 34</td> 35<td class="cellrowborder" valign="top" width="52.480000000000004%" headers="mcps1.2.4.1.2 "><p id="p2911mcpsimp"><a name="p2911mcpsimp"></a><a name="p2911mcpsimp"></a>Specifies the file transfer direction.</p> 36<a name="ul73571240131312"></a><a name="ul73571240131312"></a><ul id="ul73571240131312"><li><strong id="b0778214125818"><a name="b0778214125818"></a><a name="b0778214125818"></a>-g</strong>: downloads files from the TFTP server.</li><li><strong id="b7168132555814"><a name="b7168132555814"></a><a name="b7168132555814"></a>-p</strong>: uploads files to the TFTP server.</li></ul> 37</td> 38<td class="cellrowborder" valign="top" width="26.729999999999997%" headers="mcps1.2.4.1.3 "><p id="p14399194271310"><a name="p14399194271310"></a><a name="p14399194271310"></a>N/A</p> 39</td> 40</tr> 41<tr id="row2921mcpsimp"><td class="cellrowborder" valign="top" width="20.79%" headers="mcps1.2.4.1.1 "><p id="p2923mcpsimp"><a name="p2923mcpsimp"></a><a name="p2923mcpsimp"></a>-l FullPathLocalFile</p> 42</td> 43<td class="cellrowborder" valign="top" width="52.480000000000004%" headers="mcps1.2.4.1.2 "><p id="p2925mcpsimp"><a name="p2925mcpsimp"></a><a name="p2925mcpsimp"></a>Specifies the complete path of a local file.</p> 44</td> 45<td class="cellrowborder" valign="top" width="26.729999999999997%" headers="mcps1.2.4.1.3 "><p id="entry2926mcpsimpp0"><a name="entry2926mcpsimpp0"></a><a name="entry2926mcpsimpp0"></a>N/A</p> 46</td> 47</tr> 48<tr id="row2927mcpsimp"><td class="cellrowborder" valign="top" width="20.79%" headers="mcps1.2.4.1.1 "><p id="p2929mcpsimp"><a name="p2929mcpsimp"></a><a name="p2929mcpsimp"></a>-r RemoteFile</p> 49</td> 50<td class="cellrowborder" valign="top" width="52.480000000000004%" headers="mcps1.2.4.1.2 "><p id="p2931mcpsimp"><a name="p2931mcpsimp"></a><a name="p2931mcpsimp"></a>Specifies the file name on the server.</p> 51</td> 52<td class="cellrowborder" valign="top" width="26.729999999999997%" headers="mcps1.2.4.1.3 "><p id="entry2932mcpsimpp0"><a name="entry2932mcpsimpp0"></a><a name="entry2932mcpsimpp0"></a>N/A</p> 53</td> 54</tr> 55<tr id="row2933mcpsimp"><td class="cellrowborder" valign="top" width="20.79%" headers="mcps1.2.4.1.1 "><p id="p2935mcpsimp"><a name="p2935mcpsimp"></a><a name="p2935mcpsimp"></a>Host</p> 56</td> 57<td class="cellrowborder" valign="top" width="52.480000000000004%" headers="mcps1.2.4.1.2 "><p id="p2937mcpsimp"><a name="p2937mcpsimp"></a><a name="p2937mcpsimp"></a>Specifies the server IP address.</p> 58</td> 59<td class="cellrowborder" valign="top" width="26.729999999999997%" headers="mcps1.2.4.1.3 "><p id="entry2938mcpsimpp0"><a name="entry2938mcpsimpp0"></a><a name="entry2938mcpsimpp0"></a>N/A</p> 60</td> 61</tr> 62</tbody> 63</table> 64 65## Usage<a name="section149795134408"></a> 66 671. Deploy a TFTP server on the server and configure the TFTP server correctly. 682. Use the **tftp** command to upload and download files on the OpenHarmony board. 693. The size of the file to be transferred cannot exceed 32 MB. 70 71 > **NOTICE:** 72 >TFTP is used for debugging and disabled by default. Do not use it in formal products. 73 74 75## Example<a name="section148921918114015"></a> 76 77Download the **out** file from the server. 78 79## Output<a name="section7872155631313"></a> 80 81``` 82OHOS # ./bin/tftp -g -l /nfs/out -r out 192.168.1.2 83TFTP transfer finish 84``` 85 86After the **tftp** command is executed, **TFTP transfer finish** is displayed if the file transfer is complete. If the file transfer fails, other information is displayed to help locate the fault. 87 88