Summary of common basic commands of win7 command line

Directory

1. Processing files and directories
2. Network connection related commands
3. Disk management
4. System related commands
5. Win+R running commands

1. Processing files and directories
1. dir View files and directories in the current directory
2. type * .* View the *.* text files in the current directory
3. more *.* You can page down to view the *.* text files in the current directory, which can be used for pipeline commands
Spacebar to page down, Enter to display the next line
4 , copy source file target file copy file (files outside the current directory should contain full path)
5, move source file target file move file
6, del source file delete file
7, rename/ren source file new file name file rename (new The file name does not contain a path) 8. robocopy /? Check robocopy help ,
robocopy is a reliable file copy command for
Windows
Directory target directory /move /e Move all files and directories in the source directory to the target directory, /mov parameter only copies files but not directories
11, d: open d drive
12, cd(chdir) \dir open the current drive letter dir directory
13, mkdir directory new directory
14. rmdir directory delete directory (/s parameter deletes the directory and sub-file subdirectories, /q quiet mode with /s parameter delete without confirmation)
15. tree directory structure
16. where /r . *.txt find out the current directory The following txt file
17assoc file name extension association

18, . means the current directory
19, .. means the previous directory
20, ? means any character
21, * means any one or more characters
22, | Pipe operator, the left command The output is used as the input of the command on the right. Commonly used pipeline commands are more, sort, find, etc.
23. Data stream redirection
1. Redirect the output to a file (by appending) and
save it in the root directory of the C drive
echo 1234>>c :\1234.txt
is saved in the current directory of the C drive
echo 1234>>c:1234.txt
Compared with the above, there is one less slash after c:
That means \ means the root directory
2. Redirect the output to a file (to overwrite The way of the original file)
echo 1234>c:1234.txt
3. Redirect command input
more<C:\User\jison\Desktop\win7 command line.txt
(redirect the file to the more command in read-only mode)


2. Network connection related commands (some commands need to right-click to run cmd as an administrator)
1. View the network connection interface:
netsh interface show interface
(this command can display all network connection ports and status of the machine)
2. Display the current network configuration information
ipconfig
ipconfig --help (display the function of each parameter of ipconfig)
3. IP connection Test (you can ping the domain name or IP address)
ping baidu.com
4. Enable or disable the local connection (you need to right-click to run cmd as an administrator)
netsh interface set interface name="local connection" admin=disable/enable
(the name is followed by Network interface name)

          netsh interface set interface name="local connection" connect=disconnect/connect
(only for non-LAN)
5. Enable or disable wireless network connection
1. Connect to wireless network (according to existing configuration file 36C)
netsh wlan connect name=36C ssid=36C
(ssid=36C is the WiFi name, optional)
2. Disconnect the wireless network
netsh wlan disconnect
6. Backup and restore the wireless network configuration file
1. Export (backup) the wireless network configuration file
netsh wlan export profile
2. Import (restore) the configuration file of the wireless network. The backup configuration file can also be imported to other computers for use. Unfortunately, you still have to re-enter the wireless password. This function is quite tasteless, because the same password is the same encryption. The password strings generated when the configuration files are backed up by different computers are actually different
netsh wlan add profile filename="absolute path" interface="wireless network connection"

7. netstat displays active tcp connections (add parameter /a to display all connection)
8. Set the IP address
1. Dynamically obtain the IP address
netsh interface ipv4 set address "local connection" dhcp or
netsh interface ipv4 set address address name="local connection" source=dhcp
2. Statically set the IP address (mask is the subnet mask, gateway is the gateway)
netsh interface ipv4 set address "local connection" static 192.168.1.100 255.255.255.0 192.168.1.1
netsh interface ipv4 set address name="local connection" source=static address="192.168.1.100" mask=" 255.255.255.0" gateway="192.168.1.1"


3. Disk management (you need to right-click the administrator to run the command prompt cmd in the attachment)
1. Display the volume label vol
vol g:
2. Modify and delete the volume label
1. Modify the volume label to jison
label g: jison or
label g: (press Enter and follow the prompts)
2. Delete the volume
label label g: (Enter and then press Enter to modify the volume label to be empty i.e. delete)
3. Disk format format
format g: /fs:ntfs /v:jison /q
g: format g drive
/fs:ntfs format to ntfs format
/q quick format
4. Convert does not damage the file will Convert fat format to ntfs
convert g: /fs:ntfs /v
g: Convert g disk
/fs:ntfs Convert to ntfs format
/v Specify verbose mode conversion
5. File system management fsutil
1. Check whether the partition has bad areas
fsutil dirty query g:
2. List all partitions
fsutil fsinfo drives
6. Disk and partition information management diskpart
1. Enter the diskpart command prompt
diskpart
2. List disk information
list disk
3. List the partition information of the current disk
list partition
4. List the information of each volume of the computer
list volume
5. Display the partition information of the selected disk
select disk 0
detail disk
6. Display the partition information of the selected partition of the selected disk
select disk 0
select partition 4
detail partition
7. Display the selected partition Volume information
select volume 4
detail partition

4. System-related commands
1. Help command to view the help document of the command. With this help command, the parameter functions of all commands can be found out.
Or command /? Use the /? of a command Parameter to view the help of the command
2. runas /user:adminjison cmd Run a command with adminjison user authority (command prompt)
3. start to open a new command prompt window
4. cmd open another command line in the current command prompt window
5. eixt exits the command line
6, date date
7, time time
8, title hehe changes the title of the command prompt window to hehe
9, cls clears the screen
10, systeminfo system information
11, ver system version
12, driverquery view device drivers
13, path display environment variables
14, shutdown /l /t 0 log out immediately
15, shutdown /s /t 0 shut down immediately (the time parameter is 0-300)
16, shutdown / r /t 0 restart immediately
17, shutdown /a cancel automatic shutdown
18, tasklist display task process, view process number
19, tskill 2656 kill the process with process number 2656
20, Ctrl+C terminate the currently executed command

5. win+ R run command (using the command prompt can also be used to open a window of a function)
1. calc: start calculator
2, notepad: open notepad3
, write: wordpad4
, mspaint: drawing
board5, snippingtool: screenshot Tools, support random screenshots6
, mplayer2: simple widnows media player
7, Sndvol: volume control
program8, osk: open on-screen keyboard9
, mstsc: remote desktop connection10
, cleanmgr: open disk cleanup tool11
, compmgmt.msc: computer Management
12, cmd: CMD command prompt
13. explorer: open explorer
14, gpedit.msc: group policy
15, logoff: logout command
16, taskmgr: task manager
17, control: control panel
18, control userpasswords2: user account control
19, shutdown -s -t 0: shutdown immediately (time t parameter is 0-300 seconds)
20: shutdown -r -t 0: restart immediately
21, shutdown -l: logout
22, regedit: registry editor
23, mmc: open console
24, services .msc: local service settings25
, winver: check Windows version26
, PowerShell: provide powerful remote processing capabilities27
, devmgmt.msc---device
manager28, diskmgmt.msc---disk management utility29
, msconfig-- - System Configuration Utility (the use of some commands can be viewed in the Tools tab)
30, magnify--------magnifying glass utility
31, secpol.msc-----local security policy
27, utilman: easy access

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326656110&siteId=291194637