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:
230Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
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
ftp>ls
The server will return:
200 PORT command successful.Considerusing PASV.
150Here comes the directory listing.
directory list
....
....
226Directory send OK.
5. Change the directory to enter:
ftp>cd directory
The server will return:
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.
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:
get filename
The file is saved in the directory location that is set using the LCD command.
Server return message:
local:file remote:file
200 PORT command successful.Considerusing PASV.
150Opening BINARY mode data connection forfile(xxx bytes).
226File send OK.
XXX bytes received in x.xx secs (x.xxx MB/s).
8, download multiple files can use wildcard characters and mget
commands . For example
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:
put file
The absolute path can be used when the file is no longer in the current local directory:
put /path/file
Again, you can upload multiple files:
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:
bye
exit
quit
Any command can disconnect the FTP server and return:
221Goodbye
SHELL-FTP command