[Comprehensive explanation of Linux commands] 094. Explore Linux commands: the use of lpq, bye and ftp

lpq

Display status information for print jobs in the print queue

Additional information

lpqThe command is used to display the status information of print tasks in the print queue.

grammar

lpq(选项)

options

  • -E: Mandatory use of encryption to connect to the server;
  • -P: The print queue status on the printer being displayed;;
  • -U: automatically optional username;
  • -a: report defined tasks for all printers;
  • -h: Specifies the print server information;
  • -l: use long format output;
  • +: Specifies the interval time for displaying the state.

bye

The command is used to interrupt the FTP connection and end the program

Additional information

byeIn command ftpmode, enter bye to interrupt the current connection operation and end ftpits execution.

grammar

bye

Example

bye

ftp

Used to set file system related functions

Additional information

ftpCommands are used to set file system related functions. ftpServers are more common on the Internet. Linux ftpThe function of the command is to use commands to control the transfer of files between the local machine and the remote machine. Here are Linux ftpsome frequently used commands of the command. I believe it will be very easy to master these Linuxand ftpoperate them.

grammar

ftp(选项)(参数)

options

  • -d: Display the instruction execution process in detail to facilitate troubleshooting or analysis of program execution;
  • -i: Close the interactive mode, do not ask any questions;
  • -g: Turn off the extended feature of supporting special characters in local host file names;
  • -n: do not use automatic login;
  • -v: Display the command execution process.

parameter

  • 主机ip: Specify the host name or address of the FTP server to connect to .

Example

ftp> ascii  # 设定以ASCII方式传送文件(缺省值) 
ftp> bell   # 每完成一次文件传送,报警提示. 
ftp> binary # 设定以二进制方式传送文件. 
ftp> bye    # 终止主机FTP进程,并退出FTP管理方式. 
ftp> case   # 当为ON时,用MGET命令拷贝的文件名到本地机器中,全部转换为小写字母. 
ftp> cd     # 同UNIX的CD命令. 
ftp> cdup   # 返回上一级目录. 
ftp> chmod  # 改变远端主机的文件权限. 
ftp> close  # 终止远端的FTP进程,返回到FTP命令状态, 所有的宏定义都被删除. 
ftp> delete # 删除远端主机中的文件. 
ftp> dir [remote-directory] [local-file] # 列出当前远端主机目录中的文件.如果有本地文件,就将结果写至本地文件. 
ftp> get [remote-file] [local-file] # 从远端主机中传送至本地主机中. 
ftp> help [command] # 输出命令的解释. 
ftp> lcd # 改变当前本地主机的工作目录,如果缺省,就转到当前用户的HOME目录. 
ftp> ls [remote-directory] [local-file] # 同DIR. 
ftp> macdef                 # 定义宏命令. 
ftp> mdelete [remote-files] # 删除一批文件. 
ftp> mget [remote-files]    # 从远端主机接收一批文件至本地主机. 
ftp> mkdir directory-name   # 在远端主机中建立目录. 
ftp> mput local-files # 将本地主机中一批文件传送至远端主机. 
ftp> open host [port] # 重新建立一个新的连接. 
ftp> prompt           # 交互提示模式. 
ftp> put local-file [remote-file] # 将本地一个文件传送至远端主机中. 
ftp> pwd  # 列出当前远端主机目录. 
ftp> quit # 同BYE. 
ftp> recv remote-file [local-file] # 同GET. 
ftp> rename [from] [to]     # 改变远端主机中的文件名. 
ftp> rmdir directory-name   # 删除远端主机中的目录. 
ftp> send local-file [remote-file] # 同PUT. 
ftp> status   # 显示当前FTP的状态. 
ftp> system   # 显示远端主机系统类型. 
ftp> user user-name [password] [account] # 重新以别的用户名登录远端主机. 
ftp> ? [command] # 同HELP. [command]指定需要帮助的命令名称。如果没有指定 command,ftp 将显示全部命令的列表。
ftp> ! # 从 ftp 子系统退出到外壳。

FTP anonymous login account password

Account: anonymous
Password: anonymous@

Close FTP connection

  • bye
  • exit
  • quit

download file

ftp> get readme.txt # 下载 readme.txt 文件
ftp> mget *.txt     # 下载 

upload files

ftp> put /path/readme.txt # 上传 readme.txt 文件
ftp> mput *.txt           # 可以上传多个文件

Learn from scratchpython

[Learn python from scratch] 92. Use Python’s requests library to send HTTP requests and process responses
[Learn python from scratch] 91. Use decorators and dictionaries to manage request paths in a simple web application
[Learn python from scratch] 93. Use dictionary management Request path
[Learn python from scratch] 89. Use WSGI to build a simple and efficient Web server
[Learn python from scratch] 88. Detailed explanation of WSGI interface: realize simple and efficient web development
[Learn python from scratch] 87. Manually build an HTTP server in Python Implementation and multi-threaded concurrent processing
[Learn python from scratch] 86. In-depth understanding of the HTTP protocol and its role in browser and server communication
[Learn python from scratch] 85. Application of parallel computing technology in Python process pool
[Learn python from scratch] ] 84. In-depth understanding of threads and processes
[Learn python from scratch] 83. Python multi-process programming and the use of process pools
[Learn python from scratch] 82. Chat program implementation based on multi-threading
[Learn python from scratch] 81. Python more Application of thread communication and queue
[Learn python from scratch] 80. Thread access to global variables and thread safety issues
[Learn python from scratch] 79. Thread access to global variables and thread safety issues
[Learn python from scratch] 78. File download case
[ Learn python from scratch] 77. TCP server programming and precautions
[learn python from scratch] 76. Server and client: key components of network communication
[learn python from scratch] 75. TCP protocol: reliable connection-oriented transmission layer communication protocol
[Learn python from scratch] 74. UDP network program: Detailed explanation of port issues and binding information
[Learn python from scratch] 73. UDP network program - sending data
[Learn python from scratch] 72. In-depth understanding of Socket communication and creation of sockets Method
[Learn python from scratch] 71. Network ports and their functions
[Learn python from scratch] 70. Network communication methods and their applications: from direct communication to routers to connect multiple networks
[Learn python from scratch] 69. Network communication and IP address classification analysis
[Learn python from scratch] 68. Greedy and non-greedy modes in Python regular expressions
[Learn python from scratch] 67. The re module in Python: regular replacement and advanced matching technology
[Learn python from scratch] 66 .In-depth understanding of regular expressions: a powerful tool for pattern matching and text processing
[Learn python from scratch] 65. Detailed explanation of Python regular expression modifiers and their applications
[Learn python from scratch] 64. The re.compile method in Python regular expressions Detailed explanation of usage
[Learn python from scratch] 63. Introduction to the re.Match class and its attributes and methods in regular expressions
[Learn python from scratch] 62. Python regular expressions: a powerful string matching tool
[Learn python from scratch] 61. Detailed explanation and application examples of property attributes in Python
[Learn python from scratch] 60. Exploration generator: a flexible tool for iteration
[Learn python from scratch] 59. Iterator: An efficient tool for optimizing data traversal
[Learn python from scratch] 58. Custom exceptions in Python and methods of raising exceptions
[Learn python from scratch] 57. Use the with keyword in Python to correctly close resources
[Learn python from scratch] 56. The importance and application of exception handling in programming
[Learn python from scratch] 55. Serialization and sum in Python Deserialization, application of JSON and pickle modules
[Learn python from scratch] 54. Writing data in memory
[Learn python from scratch] 53. CSV files and Python’s CSV module
[Learn python from scratch] 52. Reading and writing files - Python file operation guide
[Learn python from scratch] 51. Opening and closing files and their applications in Python
[Learn python from scratch] 49. Object-related built-in functions in Python and their usage
[Learn python from scratch] 48 .Detailed explanation of inheritance and multiple inheritance in Python
[Learn python from scratch] 47. The concept and basic use of inheritance in object-oriented programming
[Learn python from scratch] 46. Analysis of __new__ and __init__ methods and singletons in Python Design Patterns
[Learn python from scratch] 45. Class methods and static methods in Python
[Learn python from scratch] 44. Private properties and methods in object-oriented programming
[Learn python from scratch] 43. Examples in Python object-oriented programming Properties and class attributes
[Learn python from scratch] 42. Built-in properties and methods in Python
[Learn python from scratch] 41. python magic method (2)
[Learn python from scratch] 40. python magic method (1)
[Learn python from scratch] 39. Basic object-oriented syntax and application examples
[Learn python from scratch] 38. How to use and import Python packages
[Learn python from scratch] 37. The use and precautions of Python custom modules
[Learn python from scratch] Learn python] 36. Methods and techniques of using pip for third-party package management in Python
[Learn python from scratch] 35. Python common system modules and their usage
[Learn python from scratch] 34. Detailed explanation of the import and use of Python modules
[ Learn python from scratch] 33. The role of decorators (2)
[Learn python from scratch] 32. The role of decorators (1)
[Learn python from scratch] 31. In-depth understanding of higher-order functions and closures in Python
[From Learn python from scratch】30. In-depth understanding of recursive functions and anonymous functions
【learn python from scratch】29. "Detailed explanation of function parameters" - understand the different uses of Python function parameters
【learn python from scratch】28. Local variables and global variables in Python Variables
[Learn python from scratch] 27. The use of Python functions and nested calls
[Learn python from scratch] 25. Functions: a tool to improve the efficiency of code writing
[Learn python from scratch] 24. String operations and traversal methods in Python
[Learn python from scratch] 23. How to use sets (set) and common operations in Python
[Learn python from scratch] 22. Add, delete, modify, and query dictionary variables in Python
[Learn python from scratch] 21. Python tuples and dictionaries
[Learn python from scratch] 20. Python list operation skills and examples
[Learn python from scratch] 19. Applications of looping through lists and list nesting
[Learn python from scratch] 18. Detailed explanation of the basic operations of Python lists (1)
[From Learning python from scratch】 17. The format method of Python strings (2)
【Learning python from scratch】 16. The format method of Python strings (1)
【Learning python from scratch】 15. In-depth understanding of strings and character set encoding
【From Learning python from scratch】14. Common operations on Python strings (2)
【Learning python from scratch】13. Common operations on Python strings (1)
【Learning python from scratch】12. Python string operations and applications
【Learning python from scratch】 11. Python loop statements and control flow
[Learn python from scratch] 10. Detailed explanation of Python conditional statements and if nesting
[Learn python from scratch] 09. Conditional judgment statements in Python
[Learn python from scratch] 08. Python understands bit operations operator, operator priority
[Learn python from scratch] 07. Detailed explanation of Python operators: assignment, comparison and logical operators
[Learn python from scratch] 06. Use arithmetic operators in Python for calculations and string concatenation
[Learn from scratch] python ] 05. Output and input in Python
[Learn python from scratch] 04. Basics of Python programming: variables, data types and identifiers
[Learn python from scratch] 03. Python interactive programming and detailed explanation of comments
[Learn python from scratch] 02. Introduction to development tools
[Learn python from scratch] 01. Install and configure python

Guess you like

Origin blog.csdn.net/qq_33681891/article/details/132800146