Let's suppose there is a TCP server listening to port 8080. The client connects and sends, for example, a "hello" message after using the Netcat command:
nc localhost:8080
How can I send the "hello" message 1000 times without me being typing? Can I access the Netcat file and add a 'for' or 'while' loop?
No need to modify nc
; just pipe your input to it: yes hello | head -n 1000 | nc localhost:8080
yes hello | head -n 1000 | nc localhost:8080
yes hello | head -n 1000 | nc localhost:8080
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.