Linuxのlftpコマンドとftpコマンドの使用分析と例



Linux Lftp Command Ftp Command Usage Analysis



まず、lftpについて話しましょう

Lftpは、ftp、SETP、HTTP、FTPなどの複数のファイル転送プロトコルをサポートするファイルクライアントプログラムです。 Lftpはタブのオートコンプリートをサポートしています。タブキーをダブルクリックしないでください。可能なオプションが表示されます。

1.文法と一般的なパラメータ

Lftp (option) (parameter) The # parameter is the IP address or domain name of the site to be accessed. -f: specifies the script file to be executed by the lftp command -c: Exit after executing the specified command --help: display help information --version: Displays the version number of the command.

2.使用例

例1:lftpログイン

Lftp username: root@xxxxx address: transmission port (default 21) # When the server does not perform some restriction settings, you can log in directly through ip.

例2:ディレクトリを表示または変更する

cd ls # These two commands are consistent with the usage in Linux

例3:ファイルのダウンロード

一般的な使用法:ファイルを取得するその他の使用法は次のとおりです。



mget -c *.pdf #Download all pdf files in a way that allows breakpoints to continue. mirror aaa/ # Download the entire aaa directory and the subdirectories will be copied automatically. pget -c -n 10 file.dat #Download file.dat in a way that allows up to 10 threads to allow resumes to be resumed. You can use the default value by setting the value of pget:default-n.

例4:ファイルのアップロード

同じput、mputはファイルに対する操作であり、ダウンロードと同様にミラーを使用することもできます

Mirror -R local directory name # Reverse the local directory to the ftp site by iterating (including subdirectories).

3.構成ファイル

/etc/lftp.confに来ました
一般に、次の行を追加します。



set ftp:charset gbk set file:charset utf8 set pget:default-n 5

このように、入力するたびにコマンドを作成する必要はありません。他のセットはタブを付けてから助けることができます。

次に、ftpと言います

ftpコマンドは、ファイルシステム関連の機能を設定するために使用されます。 ftpサーバーはインターネット上でより一般的です。 Linux ftpコマンドの機能は、コマンドを使用してローカルマシンとリモートマシン間のファイル転送を制御することです。

文法とオプション

Ftp (option) (parameter) option The # parameter specifies the host name or ip address of the FTP server to be connected. -d: Display the instruction execution process in detail, which is convenient for debugging or analyzing the execution of the program. -i: Turn off interactive mode without asking any questions -g: Disables the local host file name to support the extended character of special characters. -n: Do not use automatic login -v: Displays the instruction execution process.

使用例

ftpを接続します:



ftp ip # Then enter the user name and password as prompted Or use the following format ftp - -i -n IP_ADDRESS user USERNAME PASSWORD ftp -i -n 172.25.254.36 user root 123456