学习啦>学习电脑>操作系统>Linux教程>

windows下的linux grep findstr命令

志艺分享

  findstr是Window系统自带的命令,用途是查找指定的一个或多个文件文件中包含(或通过参数 /V来控制不包含)某些特定字符串的行,并将该行完整的信息打印出来,或者打印查询字符串所在的文件名。接下来是小编为大家收集的windows下的linux grep findstr命令,希望能帮到大家。

  windows下的linux grep findstr命令

  经常用linux下的grep命令,比如:

  netstat -an|grep 1521

  其实windows下也有一个类似的命令findstr,比如:

  C:\Windows\system32>netstat -an|findstr 1521

  TCP 0.0.0.0:1521 0.0.0.0:0 LISTENING

  TCP 192.168.1.100:1521 192.168.1.100:49686 ESTABLISHED

  TCP 192.168.1.100:1521 192.168.1.100:49701 ESTABLISHED

  TCP 192.168.1.100:1521 192.168.1.100:49702 ESTABLISHED

  TCP 192.168.1.100:1521 192.168.1.100:49706 ESTABLISHED

  TCP 192.168.1.100:1521 192.168.1.100:49707 ESTABLISHED

  TCP 192.168.1.100:1521 192.168.1.100:49753 ESTABLISHED

  TCP 192.168.1.100:49686 192.168.1.100:1521 ESTABLISHED

  TCP 192.168.1.100:49701 192.168.1.100:1521 ESTABLISHED

  TCP 192.168.1.100:49702 192.168.1.100:1521 ESTABLISHED

  TCP 192.168.1.100:49706 192.168.1.100:1521 ESTABLISHED

  TCP 192.168.1.100:49707 192.168.1.100:1521 ESTABLISHED

  TCP 192.168.1.100:49753 192.168.1.100:1521 ESTABLISHED

  TCP [::]:1521 [::]:0 LISTENING

  当然windows下还有一个find命令,比如:

  C:\Windows\system32>netstat -an|find "1521"

  TCP 0.0.0.0:1521 0.0.0.0:0 LISTENING

  TCP 192.168.1.100:1521 192.168.1.100:49686 ESTABLISHED

  TCP 192.168.1.100:1521 192.168.1.100:49701 ESTABLISHED

  TCP 192.168.1.100:1521 192.168.1.100:49702 ESTABLISHED

  TCP 192.168.1.100:1521 192.168.1.100:49706 ESTABLISHED

  TCP 192.168.1.100:1521 192.168.1.100:49707 ESTABLISHED

  TCP 192.168.1.100:1521 192.168.1.100:49753 ESTABLISHED

  TCP 192.168.1.100:49686 192.168.1.100:1521 ESTABLISHED

  TCP 192.168.1.100:49701 192.168.1.100:1521 ESTABLISHED

  TCP 192.168.1.100:49702 192.168.1.100:1521 ESTABLISHED

  TCP 192.168.1.100:49706 192.168.1.100:1521 ESTABLISHED

  TCP 192.168.1.100:49707 192.168.1.100:1521 ESTABLISHED

  TCP 192.168.1.100:49753 192.168.1.100:1521 ESTABLISHED

  TCP [::]:1521 [::]:0 LISTENING

  两个命令的区别是find需要用引号引起来。

  
看了“windows下的linux grep findstr命令”还想看:

1.Linux下如何使用grep命令搜索多个单词

2.讲解Linux下grep命令的使用技巧

3.14个grep命令使用例子介绍

4.15个Linux Grep命令使用实例

    2891995