我需要找出有多少服务正在侦听我的接口(仅限 ipv4,而不是 localhost)
$ ifconfig
ens192: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.129.56.137 netmask 255.255.0.0 broadcast 10.129.255.255
inet6 dead:beef::250:56ff:feb9:8c07 prefixlen 64 scopeid 0x0<global>
inet6 fe80::250:56ff:feb9:8c07 prefixlen 64 scopeid 0x20<link>
ether 00:50:56:b9:8c:07 txqueuelen 1000 (Ethernet)
RX packets 3644 bytes 330312 (330.3 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3198 bytes 679711 (679.7 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host> …Run Code Online (Sandbox Code Playgroud) curl //website//
将为我提供源代码,但从那里我将如何过滤我们的每条唯一路径并获得它们的数量?
问题:
使用您机器上的 cURL 获取“https://www.inlanefreight.com”网站的源代码并过滤该域的所有唯一路径。提交这些路径的数量作为答案。
从问题中,我不知道“唯一路径”的含义,但我认为它的含义类似于您从执行中获得的内容
$wget -p
我使用了这种方法并且它以某种方式起作用
wget --spider --recursive https://www.inlanefreight.com
Run Code Online (Sandbox Code Playgroud)
这将显示
Found 10 broken links.
https://www.inlanefreight.com/wp-content/themes/ben_theme/fonts/glyphicons-halflings-regular.svg
https://www.inlanefreight.com/wp-content/themes/ben_theme/fonts/glyphicons-halflings-regular.eot
https://www.inlanefreight.com/wp-content/themes/ben_theme/images/testimonial-back.jpg
https://www.inlanefreight.com/wp-content/themes/ben_theme/css/grabbing.png
https://www.inlanefreight.com/wp-content/themes/ben_theme/fonts/glyphicons-halflings-regular.woff
https://www.inlanefreight.com/wp-content/themes/ben_theme/fonts/glyphicons-halflings-regular.woff2
https://www.inlanefreight.com/wp-content/themes/ben_theme/images/subscriber-back.jpg
https://www.inlanefreight.com/wp-content/themes/ben_theme/fonts/glyphicons-halflings-regular.eot?
https://www.inlanefreight.com/wp-content/themes/ben_theme/images/fun-back.jpg
https://www.inlanefreight.com/wp-content/themes/ben_theme/fonts/glyphicons-halflings-regular.ttf
FINISHED --2020-12-06 05:34:58--
Total wall clock time: 2.5s
Downloaded: 23 files, 794K in 0.1s (5.36 MB/s)
Run Code Online (Sandbox Code Playgroud)
在底部。假设 23 次下载和 10 个断开的链接加起来就是我得到的唯一路径 33,这是正确的答案。