หน้า 1 จากทั้งหมด 1

คำสั่ง ping แบบที่มีค่า Timestamp ด้วย

โพสต์โพสต์แล้ว: 18 มี.ค. 2019 17:52
โดย nuiz
ถ้าอยากให้ผลลัพธ์ของคำสั่ง Ping มี Timestamp วันที่ เวลาด้วย ให้ลองแบบนี้ครับ

โค้ด: เลือกทั้งหมด
ping 192.168.101.20 | while read pong; do echo "$(date): $pong"; done


ตัวอย่างผลลัพธ์ครับ
โค้ด: เลือกทั้งหมด
Mon Mar 18 17:50:15 +07 2019: 64 bytes from 192.168.101.20: icmp_seq=414 ttl=54 time=35.9 ms
Mon Mar 18 17:50:16 +07 2019: 64 bytes from 192.168.101.20: icmp_seq=415 ttl=54 time=35.7 ms
Mon Mar 18 17:50:17 +07 2019: 64 bytes from 192.168.101.20: icmp_seq=416 ttl=54 time=35.7 ms
Mon Mar 18 17:50:18 +07 2019: 64 bytes from 192.168.101.20: icmp_seq=417 ttl=54 time=35.7 ms
Mon Mar 18 17:50:19 +07 2019: 64 bytes from 192.168.101.20: icmp_seq=418 ttl=54 time=35.7 ms
Mon Mar 18 17:50:20 +07 2019: 64 bytes from 192.168.101.20: icmp_seq=419 ttl=54 time=35.7 ms
Mon Mar 18 17:50:21 +07 2019: 64 bytes from 192.168.101.20: icmp_seq=420 ttl=54 time=35.7 ms