Master Windows Command Line: Essential CMD, Ping, Tracert, and More
This guide explains how to open the Windows command prompt and provides clear usage examples for essential commands such as ping, tracert, ipconfig, route, netstat, telnet, common DOS commands, shortcut utilities, and creating custom cmd shortcuts for efficient system administration.
CMD is the abbreviation for command prompt. To open it, press Win+R, type cmd and press Enter.
1. ping
Usage example:
ping www.g.cn # most common usage, check internet connectivity</code>
<code>ping -l 2000 -t 192.168.1.1 # send continuous ping with 2000 bytesPing uses the ICMP protocol, not TCP/UDP ports.
2. tracert
Used to trace the route for network troubleshooting.
tracert 10.10.5.1</code>
<code>tracert www.baidu.com3. ipconfig
Shows IP configuration of the local machine.
ipconfig</code>
<code>ipconfig /all4. route
Manage the routing table.
# view routing table
route print
# add static route
route -p add 10.10.10.0 mask 255.255.255.0 192.168.1.1
# delete static route
route delete 10.10.10.05. netstat
Displays active network connections and listening ports.
netstat -ano # view port usage
netstat -ano | findstr 3390 # check specific port
tasklist | findstr "14164" # find process name by PID
taskkill /f /t /im java.exe # kill java process6. telnet
Telnet client is disabled by default; enable it via Windows Features → Turn Windows features on or off → Telnet Client.
Example usage:
telnet 10.10.10.1 8080 # test if host port is open
telnet 192.168.1.2 # remote access if telnet service is enabled7. Common DOS commands
Switch drive: d: or c:; list directory: dir; create folder: md folder; delete folder: rd folder; delete file:
del file8. Common cmd shortcuts
Quickly launch utilities: notepad, calc, mspaint, write, winver, mstsc, gpedit.msc, regedit, services, control, Firewall.cpl, wuapp, logoff, shutdown -s -t 60 (shutdown after 60 seconds), shutdown -a (cancel shutdown).
9. Custom cmd shortcuts
By adding program paths to the system PATH variable, you can launch applications directly from cmd. Example steps:
Create a folder, e.g., E:\MyCmd.
Open System Properties → Advanced → Environment Variables, edit the Path variable, and append ;E:\MyCmd.
Place shortcuts (e.g., QQScLauncher.exe) into E:\MyCmd and rename them as desired.
Run the new commands from any cmd window.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
