Introduction
cmd
Yes command
is short for command line
Although with the development of the computer industry, the application of the Windows operating system is becoming more and more widespread, and DOS is facing the fate of being eliminated, but because it is safe and stable, and some users are still using it, so the general versions of Windows Compatible, users can run DOS under the Windows system. The command prompt in the Chinese version of Windows XP further improves the compatibility with the operating commands under DOS. The user can directly input Chinese call files at the command prompt.
The command
command line can be opened by typing in the 9x system . On the NT system, it can cmd
be opened by typing . After Windows 2003, it is replaced by cmd. Use the CMD
command to query the system information or judge the quality of the network. The following picture shows CMD
the interface after startup.
Run operation
CMD
Command: 开始->运行->键入cmd或command
(You can see the system version and file system version on the command line)
CMD Command Collection
gpedit.msc
-----Group Policysndrec32
-------recorderNslookup
------- IP Address Detector is a command line tool that monitors whether DNS servers in the network can correctly implement domain name resolution. It can be used in Windows NT / 2000 / XP, but this tool is not integrated in Windows 98.explorer
------- Open Explorerlogoff
--------- logout commandshutdown
------- 60 seconds countdown shutdown commandlusrmgr.msc
---- Local users and groupsservices.msc
—Local service settingsoobe/msoobe /a
---- Check if XP is activatednotepad
-------- Open Notepadcleanmgr
------- Garbage sortingnet start messenger
---- Start Courier Servicecompmgmt.msc
—Computer Managementnet stop messenger
----- stop messenger serviceconf
----------- Start netmeetingdvdplay
-------- DVD playercharmap
-------- Start Character Mapdiskmgmt.msc
—Disk Management Utilitycalc
----------- Start calculatordfrg.msc
------- Disk Defragmenterchkdsk.exe
----- Chkdsk disk checkdevmgmt.msc
— Device Managerregsvr32 /u *.dll
---- stop dll file runningdrwtsn32
------ System Doctorrononce -p
---- Shutdown in 15 secondsdxdiag
--------- Check DirectX informationregedt32
-------Registry EditorMsconfig.exe
—System Configuration Utilityrsop.msc
------- Group Policy Result Setmem.exe
-------- Display memory usageregedit.exe-
—Registrywinchat
-------- XP comes with LAN chatprogman
-------- Program Managerwinmsd
---------system messageperfmon.msc
---- Computer performance monitoring programwinver
--------- Check Windows versionsfc /scannow
----- Scan error and recovertaskmgr
----- Task Manager (2000 / xp / 2003wmimgmt.msc
---- Open windows management architecture (WMI)wupdmgr
-------- Windows Update Programwscript
-------- Windows script host settingswrite
---------- WordPadwiaacmgr
------- Scanner and Camera Wizardwinchat
-------- XP comes with LAN chatmplayer2
------- Simple widnows media playermspaint
--------painting boardmstsc
----------remote Desktop connectionmmc
-------- Magnifying glass utilitymmc
------------ Open the consolemobsync
-------- Synchronization Commandiexpress
------- Trojan binding tools, the system comes withfsmgmt.msc
----- Shared Folder Managerutilman
-------- Auxiliary Tool Managerdcomcnfg
------- Open system component serviceddeshare
------- Open DDE sharing settingsosk
------------ Open the on-screen keyboardodbcad32
------- ODBC Data Source Manageroobe/msoobe /a
---- Check if XP is activatedntbackup
------- System backup and restorenarrator
------- Screen "Narrator"ntmsmgr.msc
---- Mobile Storage Managerntmsoprq.msc
—Mobile storage administrator operation requestnetstat -an
---- (TC) command to check the interfacesyncapp
-------- Create a briefcasesysedit
-------- System Configuration Editorsigverif
------- File signature verification programciadv.msc
------ Index service programshrpubw
-------- Create a shared foldersecpol.msc
----- Local Security Strategysyskey
--------- System encryption, once encrypted, it cannot be unlocked, protecting the double password of windows xp systemservices.msc
—Local service settingsSndvol32
------- Volume control programsfc.exe
-------- System File Checkersfc /scannow
—Windows file protectionciadv.msc
------ Index service programtourstart
------ xp introduction (roaming xp program that appears after installation)taskmgr
-------- Task Managereventvwr
------- Event Viewereudcedit
------- Word making programcompmgmt.msc
—Computer Managementpackager
------- Object packaging proceduresperfmon.msc
---- Computer performance monitoring programcharmap
-------- Start Character Mapcliconfg
------- SQL SERVER client network utilityClipbrd
-------- Clipboard Viewerconf
----------- Start netmeetingcertmgr.msc
---- Certificate Management Utilityregsvr32 /u *.dll
---- stop dll file runningregsvr32 /u zipfldr.dll
------ Cancel ZIP supportcmd.exe
-------- CMD command prompt
Detailed operation
net use ipipc$ " " /user:" "
Establish an empty IPC linknet use ipipc$ "密码" /user:"用户名"
Establish IPC non-empty linknet use h: ipc$ "密码" /user:"用户名"
Map the other party C directly after login: H to local:net use h: ipc$
After login, map the other party C: to H:net use ipipc$ /del
Remove IPC linknet use h: /del
Delete the mapping of the counterpart to the local H:net user
Username password / add Create usernet user
guest / active: yes activate guest usernet user
See which usersnet user
Account name View account propertiesnet localgroup administrators 用户名 /add
Add "user" to the administrator to give it administrator rightsnet start
See which services are turned onnet start 服务名
Start the service; (eg: net start telnet, net start schedule)net stop 服务名
Stop a servicenet time 目标ip
View the other party's timenet time 目标ip /set
Set the local computer time to synchronize with the "target IP" host time, plus the parameter / yes to cancel the confirmationnet view
Check which sharing is enabled in the local area networknet view ip
Check which sharing is enabled in the other party's LANnet config
Display system network settingsnet logoff
Disconnected sharenet pause 服务名
Suspend a servicenet send ip "文本信息"
Send a message to the other partynet ver
The type and information of the network connection being used in the LANnet share
View locally enabled sharesnet share ipc$
Turn on ipc $ sharingnet share ipc$ /del
Delete ipc $ sharenet share c$ /del
Delete C: Sharenet user guest 12345
After logging in as the guest user, change the password to 12345net password 密码
Change system login passwordnetstat -a
Check which ports are opened, commonly used netstat -annetstat -n
View the network connection of the port, commonly used netstat -annetstat -v
View ongoing worknetstat -p
Protocol name example: netstat -p tcq / ip to view the usage of a protocolnetstat -s
View usage of all protocols in usenbtstat -A ip
If one of the other party's 136 to 139 ports is open, you can view the other party's recently logged in user nametracert -参数 ip(或计算机名)
Trace route (data packet), parameter: "-w number" is used to set the timeout interval.ping ip(或域名)
Send the data of the default size of 32 bytes to the host of the other party. Parameters: "-l [space] packet size"; "-n number of times to send data"; "-t" means to keep pinging.ping -t -l 65550 ip
The ping of death (send a file larger than 64K and keep pinging becomes the ping of death)ipconfig (winipcfg)
Used for Windows NT and XP (windows 95 98) to view the local IP address, ipconfig can display all configuration information with the parameter "/ all"tlist -t
The process is displayed in a tree line list (it is an additional tool of the system, which is not installed by default, in the Support / tools folder of the installation directory)kill -F
The process name is forced to end a process after adding -F parameter (for additional tools of the system, the default is not installed, in the Support / tools folder of the installation directory)del -F 文件名
After adding the -F parameter, you can delete the read-only files, / AR, / AH, / AS, / AA means to delete the read-only, hidden, system, archive files, / AR, / AH, / AS, / AA means to delete Files other than read-only, hidden, system, and archive. For example, "DEL / AR . " Means to delete all read-only files in the current directory, "DEL / AS . " Means to delete all files in the current directory except system filesdel /S /Q 目录 或用:rmdir /s /Q 目录
/ S deletes the directory and all subdirectories and files under the directory. At the same time, use the parameter / Q to cancel the system confirmation when deleting the operation and delete it directly. (The two commands have the same effect)move
The file name of the drive letter path to be moved stores the path of the moved file. After the file name is moved, the file name moves the file. The parameter / y will cancel the confirmation of the existence of the same file in the moving directory.fc one.txt two.txt > 3st.txt
Compare the two files and output the differences to the 3st.txt file, ">" and ">>" is the redirection commandat id号
Open a registered scheduled taskat /delete
Stop all scheduled tasks, use parameter / yes to stop without confirmationat id号 /delete
Stop a registered scheduled taskat
View all scheduled tasksat ip time 程序名(或一个命令) /r
Run the other party's program at a certain time and restart the computerfinger username @host
See which users have logged in recentlytelnet ip 端口
Yuanhe login server, the default port is 23open ip
Connect to IP (a telnet login command)telnet
Type telnet directly on the machine to enter the machine's telnetcopy 路径文件名1 路径文件名2 /y
Copy file 1 to the specified directory as file 2, use parameter / y to cancel at the same time confirm that you want to rewrite an existing directory filecopy c:srv.exe ipadmin$
Copy the local c: srv.exe to the other party's admincopy 1st.jpg/b+2st.txt/a 3st.jpg
Hide the contents of 2st.txt into 1st.jpg to generate a new file of 3st.jpg. Note: The header of 2st.txt should be empty in three rows. Parameters: / b refers to binary file, / a refers to ASCLL formatcopy ipadmin$svv.exe c: 或:copyipadmin$*.*
Copy the srv.exe file (all files) shared by the other party's admini $ to local C:xcopy
To copy the file or directory tree target address directory name, copy the file and directory tree, use the parameter / Y will not prompt to overwrite the same file. Use the parameter / e to copy the subdirectories under the directory to the target addresstftp -i
Own IP (this is the meat machine IP when using the meat machine as a springboard) get server.exe c: server.exe After logging in, download the "IP" server.exe to the target host c: server.exe Parameters: -i refers to Transfer in binary mode, such as when transferring exe files, or transfer it in ASCII mode (transfer text file mode) if -i is not addedtftp -i
After the other party's IP put c: server.exe` login, upload the local c: server.exe to the hostftp ip 端口
Used to upload files to the server or perform file operations. The default port is 21. bin refers to the transmission in binary mode (executable file into); the default is ASCII format transmission (when text file)route print
Display IP routing, will mainly display the network address Network addres, subnet mask Netmask, gateway address Gateway addres, interface addressarp
View and process the ARP cache, ARP means name resolution, and is responsible for resolving an IP into a physical MAC address. arp -a will display all informationstart 程序名或命令 /max 或/min
Open a new window and maximize (minimize) a certain program or commandmem
View cpu usageattrib 文件名(目录名)
View the attributes of a file (directory)attrib 文件名
-A -R -S -H or + A + R + S + H remove (add) the archive of a file, read-only, system, hidden attributes; use + to add as an attributedir
View files, parameters: / Q shows which user the file and directory belong to, / T: C shows file creation time, / T: A shows file last accessed time, / T: W last modified timedate /t 、 time /t
Use this parameter ie "DATE / T", "TIME / T" will only display the current date and time, without having to enter a new date and timeset 指定环境变量名称=要指派给变量的字符
Set environment variablesset
Show all current environment variablesset p(或其它字符)
Show all environment variables currently starting with the character p (or other characters)pause
Pause the batch process and display: press any key to continue ...if
Perform conditional processing in a batch program (see the if command and variables for more instructions)goto
The label directs cmd.exe to the labeled line in the batch program (the label must be on a separate line and start with a colon, for example: ": start" label)call
Path batch file name to call another batch program from the batch program (see call /? For more instructions)for
Execute a specific command for each file in a set of files (see the for command and variables for more instructions)echo on或off
Open or close the echo, only use echo without parameters to display the current echo settingsecho 信息
Display information on the screenecho 信息 >> pass.txt
Save "information" to pass.txt filefindstr "Hello" aa.txt
Find the string hello in the aa.txt filefind 文件名
Find a filetitle 标题名字
Change the CMD window title namecolor 颜色值
Set the foreground and background colors of the cmd console; 0 = black, 1 = blue, 2 = green, 3 = light green, 4 = red, 5 = purple, 6 = yellow, 7 = white, 8 = gray, 9 = light blue , A = light green, B = light green, C = light red, D = light purple, E = light yellow, F = bright whiteprompt 名称
Change the command prompt displayed by cmd.exe (change C: and D: to: EntSky)ver
Display version information in DOS windowwinver
A window pops up to display version information (memory size, system version, patch version, computer name)format 盘符 /FS:类型
Format disk, type: FAT, FAT32, NTFS, for example: Format D: / FS: NTFSmd 目录名
Create a directoryreplace 源文件
Directory replacement file to replace fileren 原文件名 新文件名
Rename file nametree
The directory is displayed in a tree structure, and the parameter -f will list the file names in the first foldertype 文件名
Display the contents of a text filemore 文件名
Display output file screen by screendoskey
Command to be locked = characterdoskey 要解锁命令=
The lock command provided for DOS (edit the command line, recall the win2k command and create a macro) For example: lock dir command: doskey dir = entsky (doskey dir = dir cannot be used); unlock: doskey dir =taskmgr
Bring up the task managerchkdsk /F D:
Check disk D and display status report; add parameter / f and fix errors on disktlntadmn
Telnt service admn, type tlntadmn to select 3, and then select 8, you can change the default port 23 of the telnet service to any other portexit
Exit the cmd.exe program or currently, use the parameter / B to exit the current batch script instead of cmd.exepath
The file name of the path executable file is an executable file and a path is set.cmd
Start a win2K command interpretation window. Parameters: / eff, / en turn off, turn on command expansion; for more details, see cmd /?regedit /s
The registry file name is imported into the registry; the parameter / S refers to quiet mode import without any prompt;regedit /e
Registry file name export registrycacls 文件名 参数
Display or modify the file access control list (ACL)-for NTFS format. Parameters: / D user name: set to deny access to a user; / P user name: perm replaces the access rights of the specified user; / G user name: perm gives the specified user access rights; Perm can be: N none, R read, W write, C change (write), F has full control; for example: cacls D: est.txt / D pub set d: est.txt to deny pub user access.cacls 文件名
View the file access user permission listREM 文本内容
Add comments in batch filenetsh
View or change the local network configuration
New commands under the win2003 system (practical part)
shutdown /参数
Shut down or restart the local or remote host.参数说明:/S
Shut down the host, / R restarts the host, the / T number sets the delay time, the range is between 0 and 180 seconds, / A cancels the boot, / M // IP specifies the remote host.
Example: shutdown / r / t 0 restart the local host immediately (no delay)taskill /参数
The process name or process pid terminates one or more tasks and processes.参数说明:/PID
To terminate the pid of a process, use the tasklist command to obtain the pid of each process, / IM the process name of the process to be terminated, / F to force the process to terminate, / T to terminate the specified process and the child processes he started.tasklist
Displays the processes, services, and process identifiers (PID) of the processes currently running on the local and remote hosts.参数说明:/M
List the dll files loaded by the current process. / SVC shows the corresponding service of each process. If there is no parameter, only the current process is listed.
IIS Service Command
iisreset /reboot
Restart the win2k computer (but there will be a prompt that the system will restart the message appears)iisreset /start或stop
Start (stop) all Internet servicesiisreset /restart
Stop and restart all Internet servicesiisreset /status
Show all Internet service statusiisreset /enable或disable
Enable (disable) restart of Internet services on the local systemiisreset /rebootonerror
When starting, stopping or restarting Internet services, restart the computer if an error occursiisreset /noforce
If the Internet service cannot be stopped, the Internet service will not be forcibly terminatediisreset /timeout
When Val reaches the timeout (seconds), the Internet service has not been stopped. If / rebootonerror is specified, the computer will restart. The default value is 20 seconds to restart, 60 seconds to stop, and 0 seconds to restart.
FTP commands
The command line format of ftp is:
ftp -v -d -i -n -g [host name]
-v Display all the response information of the remote server.
-D Use debugging mode.
-N Restrict automatic login of ftp, that is, do not use .netrc file.
-G cancel the global file name.
help [命令] 或 ?[命令]
View command descriptionbye 或 quit
Terminate the host FTP process and exit the FTP management mode.pwd
List the current remote host directoryput 或 send 本地文件名 [上传到主机上的文件名]
Transfer a local file to a remote hostget 或 recv [远程主机文件名] [下载到本地后的文件名]
Transfer from remote host to local hostmget [remote-files]
Receive a batch of files from the remote host to the local hostmput local-files
Transfer a batch of files from the local host to the remote hostdir 或 ls [remote-directory] [local-file]
List the files in the current remote host directory. If there is a local file, write the result to the local fileascii
Set to transfer files in ASCII mode (default)bin 或 image
Set to transfer files in binary modebell
Every time the file transfer is completed, the alarm promptscdup
Return to the previous directoryclose
Interrupt the ftp session with the remote server (corresponding to open)open host[port]
Establish a specified ftp server connection, you can specify the connection portdelete
Delete files in remote hostmdelete [remote-files]
Delete a batch of filesmkdir directory-name
Create a directory in the remote hostrename [from] [to]
Change the file name in the remote hostrmdir directory-name
Delete a directory in a remote hoststatus
Show current FTP statussystem
Display remote host system typeuser user-name [password] [account]
Re-login to the remote host with another usernameopen host [port]
Re-establish a new connectionprompt
Interactive prompt modemacdef
Define Macro Commandlcd
Change the working directory of the current local host, if default, go to the current user's HOME directorychmod
Change the file permissions of the remote hostcase
When ON, the file name copied with the MGET command is transferred to the local machine, all converted to lowercasecd remote-dir
Enter the remote host directorycdup
Go to the parent directory of the remote host directory!
Execute an interactive shell on the local machine and exit to the ftp environment, such as! Ls * .zip
MYSQL command
mysql -h host address -u username -p password to connect MYSQL; if MYSQL is just installed, the super user root has no password. (Example: mysql -h110.110.110.110 -Uroot -P123456
Note: u and root can be used without adding spaces, the same is true for others)
exit
Exit MYSQLmysqladmin -u用户名 -p旧密码 password 新密码
change Passwordgrant select on 数据库.* to 用户名@登录主机 identified by "密码";
Add new users. (Note: Unlike the above, the following are commands in the MYSQL environment, so they are followed by a semicolon as the command end character)show databases;
The database list is displayed. At the beginning, there were only two databases: mysql and test. The mysql library is very important. It contains MYSQL system information. We change the password and add users. In fact, we use this library to operate.use mysql;
show tables;
Display the data table in the librarydescribe 表名;
Display the structure of the data tablecreate database 库名;
Build a libraryuse 库名;
create table 表名 (字段设定列表);
Build tabledrop database 库名;
drop table 表名;
Delete library and delete tabledelete from 表名;
Clear records in the tableselect * from 表名;
Show records in tablemysqldump --opt school>school.bbb 备份数据库:
(The command is executed under the DOS mysqlin directory); Note: Back up the database school to the school.bbb file. School.bbb is a text file, and the file name is arbitrary. Open to see if you will find new discoveries.
This article from the network, after finishing more suitable for reading and publishing, content from: https://www.cnblogs.com/accumulater/p/7110811.html