Linux terminal access FTP and upload download files __linux

Source: Internet
Author: User
Tags auth dba mkdir

Today, my colleague asked me a question, access FTP under Linux, and upload the file. I've been using the WinSCP tool before. First file from Linux Copy to Windows, and then upload to FTP. Google a bit. Method is also relatively simple. This is only discussed through terminals, because it can also be done via IE or other tools.

1. Linux Terminal Connection FTP

[Oracle@dave ~]$ FTP 10.85.7.97

Connected to 10.85.7.97.

Serv-u FTP Server v6.4 for WinSock ready ...

' AUTH ': Command not understood.

' AUTH ': Command not understood.

Kerberos_v4 rejected as an authentication type

Name (10.85.7.97:oracle): Super

331 User name Okay, need password.

Password:-Linux password is not echo

230 User logged in, proceed.

Remote system type is UNIX.

Using binary mode to transfer files.

Ftp>

If FTP allows anonymous users, then the user name to enter anonymous, password arbitrary. You can't just hit enter.

2. View FTP command

Ftp>?

Commands may be abbreviated. Commands are:

! CR Mdir Proxy Send

$ delete mget SendPort site

Account Debug mkdir put size

Append dir mls pwd status

ASCII disconnect mode quit struct

Bell Form Modtime Quote System

Binary get mput recv sunique

Bye Glob newer Reget Tenex

Case Hash Nmap Rstatus Trace

CCC Help Nlist Rhelp type

CD Idle Ntrans rename user

Cdup Image Open Reset Umask

chmod LCD Passive Restart verbose

Clear LS private rmdir?

Close Macdef Prompt Runique

Cprotect Mdelete Protect Safe

A description of each command can be viewed through the help command

Ftp> help put

Put send one file

Ftp> Help Mput

Mput Send multiple Files

3. Upload file

Putting command: Format: Put local-file [remote-file] Upload a file to FTP

Mput command: Format: mput local-files transfer a batch of files from a local host to a remote host.

Note: The mput command can only upload files from the current local directory to the current directory on FTP. For example, the FTP command that runs under/root/dave, only the file Linux under/root/dave will be uploaded to the current directory on the server.

Put code example:

ftp> pwd--Displays the current path on the FTP

257 "/" is current directory.

Ftp> LS--Displays the files in the current directory

Entering passive Mode (10,85,7,97,16,141)

Opening ASCII mode data connection For/bin/ls.

Drw-rw-rw-1 User Group 0 Aug 17 16:11.

Drw-rw-rw-1 User Group 0 Aug 17 16:11.

-rw-rw-rw-1 User Group 1433088 Feb 5 Aspajaxextsetup_pconline_pconline.msi

-rw-rw-rw-1 User group 197626837 Mar 8 10:00 delphiv7.0.zip

DRW-RW-RW-1 User Group 0 June 9 10:17 HHT

-rw-rw-rw-1 user group 9235148 DEC 2009 Install_hskey_v1.3.exe

-rw-rw-rw-1 user group 47316992 may 16:38 Release_4.rar

Ftp> mkdir Dave--Create a folder Dave

257 "/dave" directory created.

Ftp> CD Dave--access folder Dave

Directory changed To/dave

ftp> pwd--Displays the current directory

257 "/dave" is current directory.

Ftp> LCD--Displays the current local path, and we can upload this file from this path to the FTP server relative location

Local Directory Now/home/oracle

Ftp>! --Exit the current window, return to the Linux terminal, when we exit the terminal, it will return to the FTP.

[Oracle@dave ~]$ LS--Displays the files in the current directory

Dead.letter Scripts Sqlnet.log

[Oracle@dave ~]$ VI Dave--Create a file Dave

[Oracle@dave ~]$ VI DBA--Creating a file dBA

[Oracle@dave ~]$ LS--Displays the contents of the folder, etc, we will copy these files to FTP

Dave DBA Dead.letter Scripts Sqlnet.log

[Oracle@dave ~]$ Exit--Exit terminal, return FTP command line

Exit

ftp> LCD

Local Directory Now/home/oracle

Ftp> put DBA dba-upload the file dba you just created to the current directory of FTP and name it DBA.

LOCAL:DBA REMOTE:DBA

Entering passive Mode (10,85,7,97,16,156)

Opening BINARY mode data connection for DBA.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.