Windows 常用命令

Windows 常用命令

文件和目录管理:

  1. dir: 列出当前目录中的文件和子目录。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop> dir
    
    Directory of C:\Users\YourUsername\Desktop
    
    03/28/2024  10:00 AM    <DIR>          .
    03/28/2024  10:00 AM    <DIR>          ..
    03/28/2024  09:45 AM               245 file1.txt
    03/28/2024  09:50 AM               367 file2.txt
                   2 File(s)            612 bytes
                   3 Dir(s)  50,000,000,000 bytes free
    
  2. cd: 更改当前目录。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop> cd Documents
    
    C:\Users\YourUsername\Desktop\Documents>
    
  3. mkdir: 创建新目录。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop\Documents> mkdir NewFolder
    
    C:\Users\YourUsername\Desktop\Documents>
    
  4. rmdir or rd: 删除目录。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop\Documents> rmdir NewFolder
    The system cannot find the file specified.
    
    C:\Users\YourUsername\Desktop\Documents>
    
  5. del or erase: 删除文件。

    模拟执行(示例删除文件file1.txt):
    plaintextCopy code
    C:\Users\YourUsername\Desktop\Documents> del file1.txt
    Deleting file1.txt
    
    C:\Users\YourUsername\Desktop\Documents>
    
  6. copy: 复制文件。

    模拟执行(示例复制文件file1.txt为file3.txt):
    plaintextCopy code
    C:\Users\YourUsername\Desktop\Documents> copy file1.txt file3.txt
            1 file(s) copied.
    
    C:\Users\YourUsername\Desktop\Documents>
    
  7. move: 移动文件。

    模拟执行(示例移动文件file3.txt到上一级目录):
    plaintextCopy code
    C:\Users\YourUsername\Desktop\Documents> move file3.txt ..\
            1 file(s) moved.
    
    C:\Users\YourUsername\Desktop\Documents>
    
  8. rename or ren: 重命名文件。

    模拟执行(示例将file2.txt重命名为newfile2.txt):
    plaintextCopy code
    C:\Users\YourUsername\Desktop\Documents> rename file2.txt newfile2.txt
    
    C:\Users\YourUsername\Desktop\Documents>
    

系统信息和管理:

  1. systeminfo: 显示系统信息。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop\Documents> systeminfo
    
    OS Name:                   Microsoft Windows 10 Pro
    OS Version:                10.0.19042 N/A Build 19042
    OS Manufacturer:           Microsoft Corporation
    ...
    
  2. tasklist: 显示正在运行的进程列表。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop\Documents> tasklist
    
    Image Name                     PID Session Name        Session#    Mem Usage
    ========================= ======== ================ =========== ============
    System Idle Process              0 Services                   0          8 K
    System                           4 Services                   0      9,272 K
    ...
    
  3. shutdown: 关闭或重启计算机。

    模拟执行(示例关机):
    plaintextCopy code
    C:\Users\YourUsername\Desktop\Documents> shutdown /s /t 0
    
  4. sfc: 系统文件检查工具。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop\Documents> sfc /scannow
    
    Beginning system scan...
    ...
    

网络:

  1. ipconfig: 显示网络配置信息。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop\Documents> ipconfig
    
    Windows IP Configuration
    
    Ethernet adapter Ethernet:
    
       Connection-specific DNS Suffix  . :
       Link-local IPv6 Address . . . . . : fe80::xxxx:xxxx:xxxx:xxxx%12
       IPv4 Address. . . . . . . . . . . : 192.168.1.100
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Default Gateway . . . . . . . . . : 192.168.1.1
    ...
    
  2. ping: 向指定的主机发送 ICMP 回显请求。

    模拟执行(示例Ping谷歌):
    plaintextCopy code
    C:\Users\YourUsername\Desktop\Documents> ping www.google.com
    
    Pinging www.google.com [216.58.192.4] with 32 bytes of data:
    Reply from 216.58.192.4: bytes=32 time=10ms TTL=117
    Reply from 216.58.192.4: bytes=32 time=11ms TTL=117
    ...
    
  3. tracert or traceroute: 显示数据包从本地计算机到目标计算机的路径。

    模拟执行(示例Traceroute谷歌):
    plaintextCopy code
    C:\Users\YourUsername\Desktop\Documents> tracert www.google.com
    
    Tracing route to www.google.com [216.58.192.4]
    over a maximum of 30 hops:
    
      1     1 ms     1 ms     1 ms  192.168.1.1
      2     7 ms     5 ms     6 ms  10.0.0.1
      ...
    
  4. nslookup: 查询域名对应的IP地址。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop\Documents> nslookup www.example.com
    
    Server:  UnKnown
    Address:  192.168.1.1
    
    Non-authoritative answer:
    Name:    www.example.com
    Addresses:  93.184.216.34
              2606:2800:220:1:248:1893:25c8:1946
    
  5. netstat: 显示网络连接和端口号。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop\Documents> netstat -ano
    
    Active Connections
    
      Proto  Local Address          Foreign Address        State           PID
      TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       1234
      TCP    192.168.1.100:12345    8.8.8.8:443            ESTABLISHED     5678
      ...
    
  6. arp: 显示本地网络上的ARP缓存。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop\Documents> arp -a
    
    Interface: 192.168.1.100 --- 0x2
      Internet Address      Physical Address      Type
      192.168.1.1           00-11-22-33-44-55     dynamic
      192.168.1.2           00-aa-bb-cc-dd-ee     dynamic
      ...
    

用户和安全:

  1. net user: 显示本地用户账户信息。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop\Documents> net user
    
    User accounts for \\COMPUTERNAME
    
    -------------------------------------------------------------------------------
    Administrator            Guest                    User
    The command completed successfully.
    
  2. netsh firewall: 防火墙配置信息。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop\Documents> netsh firewall show config
    
    Domain profile configuration (current):
    -------------------------------------------------------------------
    Operational mode                  = Enable
    ...
    
  3. cipher: 清除未使用的磁盘空间。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop\Documents> cipher /w:C
    
    正在清除 C:\ 中的未使用的磁盘空间:  100%
    已完成。
    

其他:

  1. bitsadmin: 后台智能传输服务(BITS)作业列表。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop\Documents> bitsadmin /list /allusers
    
    BITSAdmin version 3.0 [ 7.5.7601 ]
    BITS administration utility.
    (C) Copyright 2000-2006 Microsoft Corp.
    
    {2C5AB123-4567-8901-2345-678901234567} 'ExampleJob' SUSPEND
        Files: 1 / 1     COMPLETE
    
  2. wevtutil: 显示事件日志。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop\Documents> wevtutil qe System /c:10 /rd:true
    
    Start Time: 28/03/2024 12:00:00
    End Time: 28/03/2024 13:00:00
    ...
    

网络安全常用

  1. net user: 显示本地用户账户信息。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop> net user
    
    User accounts for \\COMPUTERNAME
    
    -------------------------------------------------------------------------------
    Administrator            Guest                    User
    The command completed successfully.
    
  2. netsh advfirewall show allprofiles: 显示防火墙配置信息。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop> netsh advfirewall show allprofiles
    
    Domain Profile Configuration (current):
    --------------------------------------------------
    Operational mode                  = Enable
    ...
    
  3. ipconfig: 显示网络配置信息。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop> ipconfig
    
    Windows IP Configuration
    
    Ethernet adapter Ethernet:
    
       Connection-specific DNS Suffix  . :
       Link-local IPv6 Address . . . . . : fe80::xxxx:xxxx:xxxx:xxxx%12
       IPv4 Address. . . . . . . . . . . : 192.168.1.100
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Default Gateway . . . . . . . . . : 192.168.1.1
    ...
    
  4. ping: 向指定的主机发送 ICMP 回显请求。

    模拟执行(示例Ping谷歌):
    plaintextCopy code
    C:\Users\YourUsername\Desktop> ping www.google.com
    
    Pinging www.google.com [216.58.192.4] with 32 bytes of data:
    Reply from 216.58.192.4: bytes=32 time=10ms TTL=117
    Reply from 216.58.192.4: bytes=32 time=11ms TTL=117
    ...
    
  5. tracert or traceroute: 显示数据包从本地计算机到目标计算机的路径。

    模拟执行(示例Traceroute谷歌):
    plaintextCopy code
    C:\Users\YourUsername\Desktop> tracert www.google.com
    
    Tracing route to www.google.com [216.58.192.4]
    over a maximum of 30 hops:
    
      1     1 ms     1 ms     1 ms  192.168.1.1
      2     7 ms     5 ms     6 ms  10.0.0.1
      ...
    
  6. nslookup: 查询域名对应的 IP 地址。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop> nslookup www.example.com
    
    Server:  UnKnown
    Address:  192.168.1.1
    
    Non-authoritative answer:
    Name:    www.example.com
    Addresses:  93.184.216.34
              2606:2800:220:1:248:1893:25c8:1946
    
  7. netstat: 显示网络连接和端口号。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop> netstat -ano
    
    Active Connections
    
      Proto  Local Address          Foreign Address        State           PID
      TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       1234
      TCP    192.168.1.100:12345    8.8.8.8:443            ESTABLISHED     5678
      ...
    
  8. arp: 显示本地网络上的 ARP 缓存。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop> arp -a
    
    Interface: 192.168.1.100 --- 0x2
      Internet Address      Physical Address      Type
      192.168.1.1           00-11-22-33-44-55     dynamic
      192.168.1.2           00-aa-bb-cc-dd-ee     dynamic
      ...
    
  9. nbtstat: 显示 NetBIOS over TCP/IP (NetBT) 协议统计信息、表格和缓存信息。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop> nbtstat -a RemoteHost
    
    Local Area Connection:
    Node IpAddress: [192.168.1.100] Scope Id: []
    
           NetBIOS Remote Machine Name Table
    
       Name               Type         Status
    ---------------------------------------------
    REMOTEHOST      <00>  UNIQUE      Registered
    REMOTEHOST      <03>  UNIQUE      Registered
    ...
    
  10. route: 显示或修改本地 IP 路由表。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop> route print
    
    ===========================================================================
    Interface List
      15...00 1a 2b 3c 4d 5e ......Ethernet
      ...
    ===========================================================================
    
    IPv4 Route Table
    ===========================================================================
    Active Routes:
    Network Destination        Netmask          Gateway       Interface  Metric
              0.0.0.0          0.0.0.0      192.168.1.1     192.168.1.100    10
              ...
    ===========================================================================
    
  11. tasklist: 显示正在运行的进程列表。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop> tasklist
    
    Image Name                     PID Session Name        Session#    Mem Usage
    ========================= ======== ================ =========== ============
    System Idle Process              0 Services                   0          8 K
    System                           4 Services                   0      9,272 K
    ...
    
  12. taskkill: 终止正在运行的进程。

    模拟执行(示例终止 PID 1234 的进程):
    plaintextCopy code
    C:\Users\YourUsername\Desktop> taskkill /pid 1234 /f
    SUCCESS: The process with PID 1234 has been terminated.
    
  13. schtasks: 计划和管理定时任务。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop> schtasks /query /fo LIST
    
    Folder: \
    ...
    
  14. wevtutil: 查询和管理 Windows 事件日志。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop> wevtutil qe System /c:10 /rd:true
    
    Start Time: 28/03/2024 12:00:00
    End Time: 28/03/2024 13:00:00
    ...
    
  15. bitsadmin: 后台智能传输服务(BITS)作业列表。

    模拟执行:
    plaintextCopy code
    C:\Users\YourUsername\Desktop> bitsadmin /list /allusers
    
    BITSAdmin version 3.0 [ 7.5.7601 ]
    BITS administration utility.
    (C) Copyright 2000-2006 Microsoft Corp.
    
    {2C5AB123-4567-8901-2345-678901234567} 'ExampleJob' SUSPEND
        Files: 1 / 1     COMPLETE
    
  • 6
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值