[Comprehensive explanation of Linux commands] 197. Shell command analysis: Detailed explanation of the usage of cupsenable and enable

cupsenable

Start the specified printer

Additional information

cupsenableCommand is used to start the specified printer.

grammar

cupsenable [选项] [目标]

Options

  • -E: Force the use of encryption when connecting to the server.
  • -U: Specify the username used when connecting to the server.
  • -u: Specify the user to whom the print task belongs.
  • -h: Specify the server name and port number to connect to.

parameter

  • Destination: Specify the destination printer.

enable

Enable or disable shell builtins

overview

enable [-a] [-dnps] [-f filename] [name …]

The main purpose

  • Disable one or more built-in commands.
  • Enable one or more built-in commands.
  • Directly calls $PATHan external command with the same name as the disabled built-in command and found in the path.
  • Print all built-in commands, whether disabled or not.
  • Prints the enabled built-in commands.
  • Print built-in commands that are disabled.
  • Prints the POSIX standard built-in commands that are enabled.
  • Prints the disabled POSIX standard built-in command.
  • Prints the POSIX standard built-in command, whether disabled or not.
  • Load built-in commands from dynamic libraries.
  • Remove built-in commands loaded from dynamic libraries.

Options

  • -a: Print all built-in commands, whether disabled or not.
  • -d: Remove built-in commands loaded from dynamic libraries.
  • -n: Disable built-in commands or display disabled built-in commands.
  • -p: Print in reusable format.
  • -s: Only display POSIX standard built-in commands in the started state.
  • -f: Load built-in commands in the dynamic library.
  • -ns: Print POSIX standard built-in commands that are disabled.
  • -as: Print POSIX standard built-in commands, whether disabled or not.

parameter

  • filename:Dynamic library file name.
  • name(Optional): Built-in command, there can be multiple.

return value

enableReturns successful unless nameit is not a built-in command or an error occurs.

example

# posix special builtin
# 假设没有任何内建命令被禁用
# 禁用两个 posix 标准内建命令
enable -n set source

# 打印处于禁用状态的 posix 标准内建命令
enable -ns

# 打印 POSIX 标准内建命令,无论是否禁用。
enable -as

# 打印处于启用状态的 POSIX 标准内建命令
enable -s

# 假设没有任何内建命令被禁用
# 禁用一到多个内建命令
enable -n echo pwd

# 打印所有内建命令,无论是否禁用。
enable -a

# 打印处于启用状态的内建命令
enable

# 打印处于禁用状态的内建命令
enable -n

# 启用一到多个内建命令
enable pwd

Q&A

Q: What about -fthe demonstration -dof -p?

A: To explain, I have not found a suitable example -fdue -dto my personal ability. If you have a better example, please submit a PR. After I verified that -pthere seems to be no difference whether the option is used, you can compare enable -p | cat -Aand enable | cat -Awhat is the difference. (Note: cat -Aused to display invisible characters)

Q: Is it possible to disable enablemyself? Can I still disable or enable built-in commands later?

A: Yes; no.

Notice:

When a Linux Shell command is executed, the Shell always first searches for the command in its own Shell builtin. If it is found, the command is executed; if the command is not found, the command to be executed is searched sequentially from the $PATHpath specified by the environment variable. . It seems that there is no way to write user's own commands to replace the Shell builtin commands. Fortunately, with enablethe command we can do just that.

For knowledge about the priority of calling commands with the same name, please first refer to the prompt part of the builtin command, and then continue reading the following part; when the built-in command is echonot disabled, if you want to call an external command echo, you can only write like this /usr/bin/echo; when we disable it echo, The priority order becomes this:

Functions > External Commands

If the environment in which the command is executed does not have a function, then the external command is echocalled .echo

This command is a built-in command of Bash. For related help information, please see helpcommand.

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/133294950