最常用Linux命令的Windows对应命令
The Windows equivalents of the most used Linux commands

原始链接: http://techkettle.blogspot.com/2026/04/the-windows-equivalents-of-most-used.html

## Windows 命令提示符与 Linux 命令的对应关系 虽然 Linux 以其命令行功能而闻名,但 Windows 通过其命令提示符 (cmd) 提供了类似的功能。这使得在操作系统之间平滑过渡成为可能。 以下是一些关键的对应关系:过滤输出 (Linux `grep`,Windows `findstr`),使用 `tcpdump` 和 Wireshark 捕获网络流量(使用内置的 Windows SSH 客户端),检查监听端口 (`netstat` 在两者中都可用),查看文件内容 (`cat` vs. `type`),以及列出目录内容 (`ls` vs. `dir`)。 对于系统管理,Windows 提供 `tasklist`(类似于 Linux 的 `top` 或 `ps aux`)来查看进程,以及 `taskkill`(类似于 `kill`)来终止它们。可以使用 `ipconfig /all`(vs. `ifconfig`)检查网络配置,并使用 `tracert`(vs. `traceroute`)跟踪网络路由。最后,`cls` 清屏,就像 Linux 中的 `clear` 一样。 掌握这些 cmd 对应关系可以帮助用户有效地排除故障并管理系统,无论操作系统如何。

对不起。
相关文章

原文

Whether it is to pipe the Tcpdump output to another machine hosting Wireshark or checking which service is listening on which port, Windows cmd has similar commands that are present in Linux. Here is some of the most command used in Linux that have equivalent purpose on Windows:

Filtering the output of a commande:

  • Linux: lsof -s | grep 'https'
  • Windows: netstat -n -a | findstr "https" (//note the double quotes)

Piping tcp dump to another machines that hosts Wireshark

Author's note: From here on, the content is AI-generated

  • Linux: ssh root@remote-linux "tcpdump -s 0 -U -n -w - -i eth0 not port 22" | wireshark -k -i -
  • Windows: ssh root@remote-linux "tcpdump -s 0 -U -n -w - -i eth0 not port 22" | "C:\Program Files\Wireshark\wireshark.exe" -k -i - (//note that Windows 10 and 11 come with a native SSH client built into cmd!)

Checking which service is listening on which port

  • Linux: netstat -tulpn
  • Windows: netstat -ano (//note that this gives you the PID (Process ID) which you can then look up in the Task Manager or using the 'tasklist' command)

Viewing the contents of a file directly in the terminal

  • Linux: cat filename.txt
  • Windows: type filename.txt

Listing the contents of a directory (including hidden files)

  • Linux: ls -la
  • Windows: dir /a

Finding a specific file by name across the system

  • Linux: find / -name "config.txt"
  • Windows: dir \config.txt /s (//the /s flag tells it to search all subdirectories)

Checking network interface configurations and IP addresses

  • Linux: ifconfig (or ip a)
  • Windows: ipconfig /all

Viewing a list of active running processes

  • Linux: top (or ps aux)
  • Windows: tasklist

Terminating or "killing" a process by its Process ID (PID)

  • Linux: kill -9 1234
  • Windows: taskkill /F /PID 1234 (//the /F flag forces the termination of the process)

Tracing the network route to a remote host

  • Linux: traceroute google.com
  • Windows: tracert google.com

Clearing the terminal screen

  • Linux: clear
  • Windows: cls

Conclusion

While Linux often gets the spotlight for its powerful command-line interface, Windows has a highly capable native command prompt as well. Whether you are troubleshooting network connectivity, managing local files, or monitoring system processes, mastering these equivalent Windows commands will make seamlessly transitioning between both operating systems a breeze.

联系我们 contact @ memedata.com