[Comprehensive explanation of Linux commands] 140.fping: A powerful tool for detecting the survivability of multiple hosts at the same time

Article directory

  • fping
    • Additional information
    • grammar
      • Options
      • parameter
    • Example
  • Learn `python` from scratch

fping

Check if the host exists

Supplementary instructions

The fping command is similar to ping, but more powerful than ping. Unlike ping which needs to wait for a certain host to connect to timeout or send back feedback information, fping immediately sends a data packet to the next host after sending a data packet to one host. Achieve simultaneous pinging of multiple hosts. At the same time, fping can also specify the range of the number of hosts to be pinged on the command line.

Grammar

fping [options] [parameters]

Options

  • -a: Display live hosts
  • -b: Set the size of ping packets (default is 56)
  • -c: Set the number of pings for each target (default is 1)
  • -f: Get the target list from a file (cannot be used with the -g option)
  • -l: Send pings in a loop
  • -g: Generate a target list by specifying the start and end addresses, which can be network segments
  • -u: Show unreachable targets

Parameters

Target: The host address to ping.

Examples

Install fping command:

# Install epel source first
yum install epel* -y
#Install fping package
yum install fping -y

Selectively ping specified IP:

$ fping 192.168.0.1 192.168.0.125 192.168.0.126 2>/dev/null
192.168.0.1 is alive
192.168.0.125 is alive
192.168.0.126 is unreachable

Ping the entire network segment:

$ fping -g 192.168.0.0/24 2>/dev/null
192.168.0.1 is alive
192.168.0.103 is alive
...
192.168.0.253 is unreachable
192.168.0.254 is unreachable

Ping the entire network segment and only display surviving hosts:

$ fping -ag 192.168.0.0/24 2>/dev/null
192.168.0.1
192.168.0.103
...

Ping a certain IP:

$ fping -ag 192.168.0.5 192.168.0.130 2>/dev/null
192.168.0.103
...
192.168.0.125
192.168.0.130

Learn python

from scratch

[Learn python from scratch] 92. Use Python’s requests library to send HTTP requests and process responses
[Learn python from scratch] 91. A simple web application that uses decorators and dictionaries to manage request paths
[Learn python from scratch] 93. Use dictionaries to manage request paths
[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: achieving simple and efficient web development
[Learn python from scratch] 87. Manually build Python implementation of HTTP server and multi-thread 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. Implementation of chat program based on multi-threading
[Learn python from scratch] 81. Application of Python multi-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: a reliable connection-oriented transport 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-send data
[Learn python from scratch] 72. In-depth understanding of Socket communication and methods of creating sockets
[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 connecting 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. Detailed explanation of the use of re.compile method in Python regular expressions
[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 deserialization in Python, application of JSON and pickle modules
[Learn python from scratch] 54. Write 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 application 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 singleton design pattern in Python
[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. Instance attributes and class attributes in Python object-oriented programming
[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] 36. Methods and techniques for 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 how to import and use 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
[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
[Learn python from scratch] 27. Use of Python functions and nested calls
[Learn python from scratch] 25. Function: a powerful 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
[Learning python from scratch] 22. Addition, deletion, modification, and dictionary variables in Python
[Learn python from scratch] 21. Tuples and dictionaries in Python
[Learn python from scratch] 20. Python list operation skills and examples
[Learn python from scratch] 19. Application of looping through lists and list nesting
[Learn python from scratch] 18. Detailed explanation of the basic operations of Python lists (1)
[Learn python from scratch] 17. Python string format method (2)
[Learn python from scratch] 16. Python string format method (1)
[Learn python from scratch] 15. In-depth understanding of string and character set encoding
[Learn python from scratch] 14. Common operations on Python strings (2)
[Learn python from scratch] 13. Common operations on Python strings (1)
[Learn python from scratch] 12. Python string operations and applications
[Learn 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 bitwise operators and operator precedence
[Learn python from scratch] 07. Detailed explanation of Python operators: assignment, comparison and logical operators
[Learn python from scratch] 06. Use arithmetic operators for calculation and string concatenation in Python
[Learn python from scratch] 05. Output and input in Python
[Learn python from scratch] 04. Python programming basics: 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