如何使用 Windows 7 中的命令行工具从 HOSTS 文件中提取条目?

lab*_*rat 0 windows command-line extract hosts-file

它涉及 HOSTS 文件,Windows 7 Ultimate 64bit。我希望将其中具有特定名称的所有条目/行写入 .txt 文件。如何在命令行工具中执行此操作?

Len*_*iey 5

那么你可以使用findstr:

findstr "localhost" C:\Windows\System32\drivers\etc\hosts > C:\localhost_hosts.txt
Run Code Online (Sandbox Code Playgroud)