Home Operation and Maintenance Linux Operation and Maintenance What are the ftp commands under linux?

What are the ftp commands under linux?

Mar 21, 2023 am 09:59 AM
linux ftp

The ftp commands under Linux include: 1. ftp command; 2. close command; 3. disconnect command; 4. open command; 5. user command; 6. account command; 7. bye command; 8. quit command; 9. help command; 10. rhelp command; 11. ascii command; 12. binary/bi command; 13. bell command, etc.

What are the ftp commands under linux?

#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.

What are the ftp commands under Linux?

Complete set of Linux FTP commands

1, Preface

Below Gives explanations and examples for all commands.

Explanation: 1. remote-file refers to the remote file, that is, the file on the server

2. local-file refers to the local file, that is, the file on the local machine

2. Login and logout commands

2.1 ftp

$ ftp 192.168.0.2

Format: ftp [host]

Host is ftp host ip, this command is used to log in to the ftp server. After logging in, you will be prompted to enter the account and password. After the account and password are entered correctly, you will log in to the server and enter the FTP subroutine.

2.2 close

FTP> close

End the FTP session with the remote server and return to the command interpreter. There is no exit from the ftp subroutine. You can use the open command to log in again.

2.3 disconnect

FTP> disconnect

Disconnect from the remote server, but still within the FTP subcommand, retaining the ftp prompt. disconnect is an alias for close.

2.4 open

FTP >open Connect to the specified FTP server.

Format: open computer [port]

Description: computer specifies the remote computer to be connected. Computers can be specified by IP address or computer name (DNS or hosts file must be available). If autologin is on (default), ftp will also attempt to automatically log the user into the FTP server. port specifies the port number used to contact the FTP server.

Eg: open 192.168.0.2, then enter the server user and password, and log in again.

2.5 user

FTP >user Specify the user of the remote computer. After logging in to the server, you can change the user.
Format: user username [password] [account]
Description: user-name specifies the user name used to log in to the remote computer. password specifies the password for user-name. If not specified, but required, ftp will prompt for a password.
account Specifies the account to use to log in to the remote computer. If account is not specified, but is required, ftp prompts you for an account.

2.6 account

FTP> account

Provide the supplementary password required to access system resources after successfully logging into the remote system

2.7 bye

FTP> bye (or by) Ends the FTP session with the remote computer and exits ftp.

2.8!

FTP> ! End the FTP session with the remote computer and exit ftp. The function is the same as bye.

2.9 quit

FTP >quit End the FTP session with the remote computer and exit ftp.

Remarks: bye,! The function is basically the same as quit.

3. Help command

3.1 ?

FTP>? Display ftp command description, same as help.
Format:? [command]
Description: command specifies the name of the command that requires instructions. If command is not specified, ftp will display a list of all commands.

3.2 help

FTP >help Displays the ftp command description.
Format: help [command]
Description: command specifies the name of the command that requires instructions. If command is not specified, ftp will display a list of all commands.

3.3 rhelp

FTP >remotehelp Display remote command help.
Format: remotehelp [command]
Description: command specifies the name of the command that requires help. If command is not specified, ftp will display a list of all remote commands.

4. File operation commands

4.1 ascii

FTP> ascii

Set the file transfer type to the default ASCII.

Note: FTP supports two file transfer types, ASCII code and binary code (binary). ASCII should be used when transferring text files.

4.2 binary/bi

FTP> binary (or bi) Set the file transfer type to binary.

4.3 bell

FTP> bell

Toggle the bell to sound after each file transfer command completes. By default, ringtones are turned off.

4.4 cd

FTP> cd

Format: cd remote-directory jumps to the remote-directory directory

4.5 cdup

FTP> cdup
Description: Change the directory on the remote computer and jump to the previous directory.

4.6 lcd

FTP >lcd Change the working directory on the local computer.

By default, the working directory is the directory where ftp is started.

Format: lcd [directory] 

Description: directory specifies the directory on the local computer to be changed. If directory is not specified, the current working directory on the local computer will be displayed.

4.7 dir

FTP> dir displays a list of remote directory files and subdirectories, the same as the ls command.

Format: dir [remote-directory] [local-file]

Description: remote-directory specifies the directory whose list you want to view. If no directory is specified, the current working directory on the remote machine will be used. Local-file specifies the local file in which to store the list. If not specified, the output will be displayed on the screen.

4.8 ls

FTP >ls displays an abbreviated list of files and subdirectories in a remote directory.

Format: ls [remote-directory] [local-file]

Description: remote-directory specifies the directory whose list you want to view. If no directory is specified, the current working directory on the remote machine will be used. local-file specifies the local file in which to store the list. If not specified, the output will be displayed on the screen.

4.9 mdir

FTP >mdir displays a list of remote directory files and subdirectories. Multiple files can be specified using mdir.
Format: mdir remote-files [...] local-file
Description: remote-files specifies the directory to view the list. remote-files must be specified. Please type - to use the current working directory on the remote machine.
local-file Specifies the local file to restore the list. Please type - to display the list on the screen.

4.10 pwd

FTP >pwd displays the current directory on the remote computer.

4.11 size

FTP> size remote-file

Display the size of the remote file

4.12 mkdir

FTP >mkdir creates a remote directory.
Format: mkdir directory
Description: directory specifies the name of the new remote directory.

4.13 rmdir

FTP >rmdir deletes the remote directory.
Format: rmdir directory
Description: directory specifies the name of the remote directory to be deleted.

4.14 rename

FTP >rename Rename remote files.
Format: rename filename newfilename
Description: filename specifies the file to be renamed. newfilename specifies a new file name.

4.15 mls

FTP >mls Displays an abbreviated list of files and subdirectories in a remote directory.

Format: mls remote-files [...] local-file
Description: remote-files specifies the files to view the list. remote-files must be specified;
Please type - to use the current working directory on the remote computer.
local-file Specifies the local file to store the list. Please type - to display the list on the screen.

4.16 chmod

FTP> chmod 755 remote_file

Description: Change the RWX attribute of the file on the remote directory

4.17 modtime

FTP >modtime remote-file displays the last modification time of the file on the remote server

Format: mput remote-files

Description: remote-files files on the remote computer

4.18 append

FTP>append local-file

Append a local file to a file on the remote computer using the current file type settings

Format: append local-file [remote-file ]

If remote-file is omitted, the local file name will be used as the remote file name.

4.19 send

FTP >send Copies local files to a remote computer using the current file transfer type. Send is the same as put.
Format: send local-file [remote-file]
Description: local-file specifies the local file to be copied. remote-file specifies the name to use on the remote computer. If not specified, the file will be named local-file.

4.20 put

 FTP >put Copies local files to the remote computer using the current file transfer type.
Format: put local-file [remote-file]
Description: local-file specifies the local file to be copied.
 remote-file specifies the name to be used on the remote computer. If not specified, the file will be named local-file.

4.21 mput

FTP >mput Multiple file transfer, copies local files to a remote computer using the current file transfer type.
Format: mput local-files [...]
Description: local-files specifies the local files to be copied to the remote computer

4.22 get

FTP> get uses the current The file conversion type copies remote files to the local computer.

Format: get remote-file [local-file]

Description: remote-file specifies the remote file to be copied.

Local-file Specifies the name to use on the local computer. If not specified, the file will be named remote-file.

4.23 mget

FTP >mget copies a remote file to the local computer using the current file transfer type.
Format: mget remote-files [...]
Description: remote-files specifies the remote files to be copied to the local computer.

4.24 reget

4.25 recv

FTP >recv Copies remote files to the local computer using the current file transfer type. Recv is the same as get.
Format: recv remote-file [local-file]
Description: remote-file specifies the remote file to be copied.
 local-file specifies the name to be used on the local computer. If not specified, the file will be named remote-file.

4.26 newer

  FTP >newer remote-filelocal-file Gets the file of the remote server, if the file is newer than the local file

Format: mput remote-file local- file [ ...]

4.27 delete

FTP> delete deletes files on the remote computer.

Format: delete remote-file

Description: remote-file specifies the file to be deleted.

4.28 mdelete

FTP >mdelete Delete files on the remote computer.
Format: mdelete remote-files [...]
Description: remote-files specifies the remote files to be deleted.

4.29 umask

Display the umask value of the remote server

5. File mode command

5.1 case

FTP> case

Trigger remote file name case change function

5.2 ccc

FTP> ccc

5.3 clear

FTP>clear

5.4 cprotect

5.5 form

Set file transfer format

5.6 glob

FTP > ;glob switches filename combinations. The

combination allows the use of wildcard characters (* and ?) in internal file or path names. By default, combining is on.

5.7 hash

FTP >hash Toggles the printing of a digital signature (#) for each data block that has been transferred.

The size of the data block is 2048 bytes. By default, hash symbol printing is turned off.

5.8 idle

5.9 image

5.10 mode

Set the file transfer model, Linux only supports stream mode (stream)

5.11 nmap

Set or cancel the file name mapping mechanism

5.12 nlist

5.13 ntrans

Set or cancel the file name character transformation mechanism

5.14 passive

5.15 private

5.16 prompt

FTP >prompt Switch prompt. If you turn off the prompt when mget and mput transfer all files, Ftp will prompt during multiple file transfers to allow you to selectively retrieve or store files. By default, prompts are on.

5.17 protect

5.18 proxy

Execute an ftp command on the auxiliary control connection

5.19 sendport

Use PORT triggered for each data connection

5.20 quote

FTP >quote Send parameters verbatim to the remote FTP server. A single FTP reply code will be returned.
Quote is the same as literal.
Format: quote argument [...]
Description: argument specifies the parameters to be sent to the FTP server.

5.21 reset

Clear the response queue

5.22 restart

5.23 runique

5.24 safe

Transfer the file Set to security protection mode

5.25 site

5.26 struct

Set the file transfer structure

5.27 sunique

Trigger the remote unique host file Storage function

5.28 tenex

Set tenex file transfer type

5.29 type

FTP >type Set or display the file transfer type.
Format: type [type-name]
Description: type-name specifies the file transfer type. The default setting is ascii. If type-name is not specified, the current type will be displayed.

6. Other commands

6.1 $

FTP> $ macro_name

Run the macro, macro_name is the name of the macro

6.2 macdef

Define macro function

6.3 cr

Trigger carriage return and line feed function

6.4 debug

FTP> debug switches debugging.

When debugging is turned on, every command sent to the remote computer is printed, preceded by the string ">". By default, debugging is turned off.

6.5 trace

FTP >trace switches packet tracing. Trace shows the route of each packet when running the ftp command.

6.6 status

FTP >status Displays the current status of FTP connections and switching.

6.7 rstatus

Display the status of the remote server

6.8 system

Display the remote host type, mainly version and kernel information

6.9 verbose

FTP >verbose Switch verbose mode. If on, all ftp responses will be displayed. After the file transfer is completed, statistical information related to transfer efficiency will be displayed at the same time. By default, verbose is on.

Related recommendations: "Linux Video Tutorial"

The above is the detailed content of What are the ftp commands under linux?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What computer configuration is required for vscode What computer configuration is required for vscode Apr 15, 2025 pm 09:48 PM

VS Code system requirements: Operating system: Windows 10 and above, macOS 10.12 and above, Linux distribution processor: minimum 1.6 GHz, recommended 2.0 GHz and above memory: minimum 512 MB, recommended 4 GB and above storage space: minimum 250 MB, recommended 1 GB and above other requirements: stable network connection, Xorg/Wayland (Linux)

How to run java code in notepad How to run java code in notepad Apr 16, 2025 pm 07:39 PM

Although Notepad cannot run Java code directly, it can be achieved by using other tools: using the command line compiler (javac) to generate a bytecode file (filename.class). Use the Java interpreter (java) to interpret bytecode, execute the code, and output the result.

Linux Architecture: Unveiling the 5 Basic Components Linux Architecture: Unveiling the 5 Basic Components Apr 20, 2025 am 12:04 AM

The five basic components of the Linux system are: 1. Kernel, 2. System library, 3. System utilities, 4. Graphical user interface, 5. Applications. The kernel manages hardware resources, the system library provides precompiled functions, system utilities are used for system management, the GUI provides visual interaction, and applications use these components to implement functions.

vscode cannot install extension vscode cannot install extension Apr 15, 2025 pm 07:18 PM

The reasons for the installation of VS Code extensions may be: network instability, insufficient permissions, system compatibility issues, VS Code version is too old, antivirus software or firewall interference. By checking network connections, permissions, log files, updating VS Code, disabling security software, and restarting VS Code or computers, you can gradually troubleshoot and resolve issues.

How to check the warehouse address of git How to check the warehouse address of git Apr 17, 2025 pm 01:54 PM

To view the Git repository address, perform the following steps: 1. Open the command line and navigate to the repository directory; 2. Run the "git remote -v" command; 3. View the repository name in the output and its corresponding address.

Can vscode be used for mac Can vscode be used for mac Apr 15, 2025 pm 07:36 PM

VS Code is available on Mac. It has powerful extensions, Git integration, terminal and debugger, and also offers a wealth of setup options. However, for particularly large projects or highly professional development, VS Code may have performance or functional limitations.

How to use VSCode How to use VSCode Apr 15, 2025 pm 11:21 PM

Visual Studio Code (VSCode) is a cross-platform, open source and free code editor developed by Microsoft. It is known for its lightweight, scalability and support for a wide range of programming languages. To install VSCode, please visit the official website to download and run the installer. When using VSCode, you can create new projects, edit code, debug code, navigate projects, expand VSCode, and manage settings. VSCode is available for Windows, macOS, and Linux, supports multiple programming languages ​​and provides various extensions through Marketplace. Its advantages include lightweight, scalability, extensive language support, rich features and version

vscode terminal usage tutorial vscode terminal usage tutorial Apr 15, 2025 pm 10:09 PM

vscode built-in terminal is a development tool that allows running commands and scripts within the editor to simplify the development process. How to use vscode terminal: Open the terminal with the shortcut key (Ctrl/Cmd). Enter a command or run the script. Use hotkeys (such as Ctrl L to clear the terminal). Change the working directory (such as the cd command). Advanced features include debug mode, automatic code snippet completion, and interactive command history.

See all articles