Common Windows CMD Commands


Windows has called cmd thing, most people probably almost never encounter using cmd scenarios under normal circumstances, as I use cmd cmd also use python library to load and test other software is installed successfully when using the python, such as in cmd in pip install xxx and java -version .

There are different types of Linux operating systems bash .

There under the X-OS Terminal .

Often call these three things is Terminal (Terminal) or shell.
Here Insert Picture Description
So what role do these Terminal? Simple statement is executed with the command line instead of the graphical interface of keyboard and mouse operation!

The following examples to understand about it!

This article describes some of the most common operations in life (such as: create, delete files and folders, to print a document tree and shutdown) command-line implementation. So how do we open cmd?

Method 0: Start menu to find inside the cmd command prompt;
Method 1: win + r key combination to open the run field, type cmd, Enter;
Method 2: shift + right mouse button, select Open Command Prompt;
Method 3: in the desired input path cmd, carriage;
...
cmd from the command and parameters , each parameter corresponding to achieve different effects, while properly using a plurality of parameters can achieve a synergistic effect.

help

Type in cmd help to see a list of available commands cmd
Here Insert Picture Description

help + command name

Use help + command name to view a parameter list and use the command.
Here Insert Picture Description

Timing shutdown operation

About the command : shutdown •
related parameters : /s /t xxx •
Usage example : shut /s /t 3600 一小时后关机 •
Description : shutdown command not only can be used to set the timing shutdown, shutdown command there are other many other parameters, /l /r /g /hetc., can be used for sleep, log off and reboot. Learn more about the usage, type help shutdown cmd in the query.
Here Insert Picture Description

Jump directory

About the command : cd •
related parameters : 文件夹路径 •
Usage example : cd /D d:/demo = d: + cd demo •
Description : cmd switch the current working directory to the D drive the demo folder; relative paths path available folders can also be used in the disk folder absolute path.
Note : You can not change directories across disk drives cd command without the / D parameter, plus / D you can switch at various locations each partition the hard disk.

new folder

About the command : md / mkdir •
commonly used parameters : 新建文件夹名字 •
Usage example : mkdir d:\demo •
Description : mkdir d: \ demo can create a new command called a demo at the D root directory folder

Delete Folder Actions

About the command : rd •
commonly used parameters : 文件夹所在位置/文件夹名 •
Usage example : rd demo •
Description : Remove the demo folder!
Note : rd Unable to delete non-empty folder (Linux Unix or DOS command to delete a folder under the more convenient)

Delete files developed

About the command : delerase •
commonly used parameters : 文件路径/文件名 •
Usage example : del d:\demo\demo.txterase d:\demo\demo.txt •
Description : This command deletes demo.txt • D drive demo directory

View the document tree structure

The order : tree •
Common parameters : /f 文件夹路径/文件名 •
Usage Example : tree d:\demo •
Description : tree d: \ demo can see the directory hierarchy in the demo directory (not show separate file), plus / f single parameter can be displayed to the document file tree, the example map
Here Insert Picture Description

Export command to run the results to a text within a document

This is rather special, but it is quite easy to use. Sometimes you want to run a command issued to the results of other people to see, and you do not want to capture and want to send plain text, but since the cmd unable to replicate the same as a normal text editor. Then how to do?

Scenario : Girlfriend let you take your PC movie folder movie list them all, she wanted to pick their favorite one watching you, of course, then you can put the computer to her selection, but also a point folder this view.

Then you think of using cmd to solve the problem.

Assuming your PC movies on the D drive next movie catalog video, so you open the cmd:

  • C: \ User \ Y> cd / D d: \ video
  • D:\视频>tree /f movie>C:\Users\Y\desktop\movie_list.txt

Then you will find no output, but open the desktop will find more than a movie_list.txt, then you just let your girlfriend find their favorite movies in the document tree inside on the line.

Haha. . . . It is not very exciting. . . . .

Create a new blank document

cmd not developed new command file, how to use cmd then we create a new blank document?

We can see from 转向符 >the usage of get inspired : > for the command to run export the results to a specific file, the file does not exist, create a new file and then import the development of operating results .
Idea : to execute arbitrary commands a no output of the output (ie blank) turned into the specified document can achieve the purpose of the new document.

Example:

type NUL>d:\example\newfile.txt
----- This command will create a new blank in the D disk directory example newfile.txt file
cd>d:\example\newfile.mp4
cd.>d:\example\newfile.mp4
----- above two commands can create a new blank document in the D drive newfile.mp4 example directory

So in theory, as long as the output is blank command, you can use the steering operator> steering functions create a new blank document!

View network connection status

For command 1 : netstat -helpget command line using the help information
Here Insert Picture Description
about the command 2 : netstat -anoView network connection status and the corresponding process id
Here Insert Picture Description

ping

ping www.baidu.com
----- ping command sends a data packet to Baidu learns the network connection
Here Insert Picture Description

Access to the local network configuration information details

ipconfig
----- access to the local network configuration information details
Here Insert Picture Description
......

If you are interested to then go explore it!

We do not need to use these things in the usual school life, but once learned, will be loaded to force you to improve the quality of life and a great tool!

Your trifecta is the greatest affirmation to me! ! !

+++ thumbs attention
thumbs +++ attention
thumbs attention +++

Published 28 original articles · won praise 47 · views 6692

Guess you like

Origin blog.csdn.net/ywsydwsbn/article/details/105230642