Summary of cmd command

cmd command summary

  • Open a command window
  • Switch drive letter
  • View current directory
  • Switch cd
  • Shortcut key method
  • Folder operation
  • Other commands
  • Global environment variable configuration

Open a command window

window+R

Switch drive letter

Example:
switch to D drive

eg:
	C:\>d:
	

View current directory

Example: View the directory in the c drive

eg:	
	C:\>dir

Switch cd

Switch to the root directory

	C:\Users\Administrator>cd /

Switch to the upper level directory

	C:\Users\Administrator>cd ../

Current directory

	C:\Users\Administrator>cd ./

Switch to a folder

	C:\Users\Administrator>cd Desktop

Shortcut key method

1. Enter the first letter of a directory, and then press tab to automatically generate the full name of the directory
2. Arrow up and down, view the history command

Folder operation

1. Create a folder
2. cmd command: md folder name

	eg:
		C:\Users\Administrator>md abc

1. Delete folder
2. cmd command: rd folder name

	eg:
		C:\Users\Administrator>rd abc

1. Delete files, only empty folders can be deleted
2. cmd command: del file name

	eg:
		C:\Users\Administrator>del abc	

1. To delete all files in the folder, you can only delete all the contents in the folder, not the folder itself.
2. cmd command: del folder\*.*

	eg:
		C:\Users\Administrator>del abc\*.*

1. Delete the folder and its contents, delete the folder itself, including all the contents in the file.
2. cmd command: rd \s \q folder

	eg:
		C:\Users\Administrator>rd \s \q abc
  • Copy
    cmd command: copy folder\file name new folder address
	eg:
		C:\Users\Administrator>copy abc\1.txt aaa
  • Move
    cmd command: move folder\file name new folder address
	eg:
		C:\Users\Administrator>move abc\1.txt aaa

Other commands

  • Clear the screen
	eg:
		C:\Users\Administrator>cls
  • View IP
	eg:
		C:\Users\Administrator>ipconfig
  • View the ping value of a link to a website
	eg:
		C:\Users\Administrator>ping www.baidu.com
  • View help
	eg:
		C:\Users\Administrator>help	
  • Use computer
	eg:
		C:\Users\Administrator>calc
  • End the current command
    cmd command: shortcut key ctrl+c

Guess you like

Origin blog.csdn.net/qwer_1014_/article/details/114269365