SHELL-FTP command

Source: Internet
Author: User
Tags ftp commands ftp connection ftp client

to supplement the switch between Linux users :

Su is switching between users, either from a normal user to the root user or from the root user to a normal user. If you are currently the root user, switch to normal user test to use the following command:
Su-test
If you want to switch back to the root user, use the following command:
Su or Su-
User name root can be omitted without writing.
Enter the root password when switching back to the root user. Generally enter the exit command directly to switch back to the root user, so you do not have to enter a password.

1, why the use of FTP in Linux prompts do not find the command

If the FTP client is not installed, the command is not prompted.

[[email protected] etc]# RPM-QA |grep FTP---Check if FTP is installed

2, VSFTPD is to provide FTP service equivalent is the service side, but it does not provide FTP command

Both set yum-y install VSFTPD FTP (install)

3. Connect the FTP server on the command first enter ftp and then space to follow the FTP server's domain name ' domain.com ' or IP address

Format: FTP [hostname| ip-address]

A) under Linux command line input: FTP 10.18.34.115

b) The server asks you for your username and password, enter yint and corresponding password separately, and wait for authentication to pass.

or use the following format

Ftp-i-N ip_address

then enter

User USERNAME PASSWORD

Like what:

Ftp-i-N 172.17.17.17

User PUB 123456

After that, the terminal will return the following information:

    1. 230Login successful.
    2. Remote system type is UNIX.
    3. Using binary mode to transfer files.
    4. ftp>

Indicates a successful login.

if the time is too long to operate and the connection is disconnected, you will need to start an FTP session
The Open command opens a session with a remote host. The general format of the command is: open hostname/IP

4. Directory Operation FTP commands can list, move, and create folders as if we were using our computer locally. You can ls print a list of directories, cd you can change the directory, mkdir you can create folders.

Listing directories using security settings

    1. ftp>ls

The server will return:

    1. 200 PORT command successful.Considerusing PASV.
    2. 150Here comes the directory listing.
    3. directory list
    4. ....
    5. ....
    6. 226Directory send OK.

5. Change the directory to enter:

    1. ftp>cd directory

The server will return:

    1. 250Directory succesfully changed.

6、PWD: Displays the directory where the remote is currently located (LPWD displays the local directory).

7. Download files using FTP

Before downloading a file, we first need to use the lcd command to set the local accept directory location.

    1. lcd /home/user/yourdirectoryname

If you do not specify a download directory, the file will be downloaded to your working directory when you log in to FTP.

Now, we can use command get to download the file, for example:

    1. get filename

The file is saved in the directory location that is set using the LCD command.

Server return message:

  1. local:file remote:file
  2. 200 PORT command successful.Considerusing PASV.
  3. 150Opening BINARY mode data connection forfile(xxx bytes).
  4. 226File send OK.
  5. XXX bytes received in x.xx secs (x.xxx MB/s).

8, download multiple files can use wildcard characters and mget commands . For example

    1. mget *.sh
9. Uploading Files using FTP

FTP can also upload files after FTP connection is completed

To put upload a file using a command:

    1. put file

The absolute path can be used when the file is no longer in the current local directory:

    1. put /path/file

Again, you can upload multiple files:

    1. mput *.xls

10. Close the FTP connection

After completing the FTP work, you need to close the connection for security reasons. There are three commands to close a connection:

    1. bye
    2. exit
    3. quit

Any command can disconnect the FTP server and return:

    1. 221Goodbye

SHELL-FTP command

Related Article

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.