Windows (DOS) basic operation
File commands
Switch directory command:
cd C:\test
Create a directory:
md file
We create file1
and file2
two directories in the file
-
First switch the directory into the file directory
cd file
-
Create file1 and file2 directories
md file1 fil2
Display file list:
dir
Modify the file name:
ren
Modify file-> file1-> hello.txt to world.txt
- cd file1
- ren hello.txt world.txt
Delete a directory or file:
rd
Delete file1 directory
-
Return to the directory above file1
cd ..
-
try
rd file1
Prompts that there is a file in file1 and cannot be deleted
Attempt
rd /s /q file1
to delete (deletion successful)/s
Deleting in quiet mode, without displaying to the user to see if the directory is empty, and delete directly.
Copy files:
(Recreate the deleted file1 and create 1.txt in file1)
Copy 1.txt in file1 to file2 folder
copy 1.txt ..\file2
..\
: Indicates the upper-level directory (relative path)
Move file
move hello.txt c:\
Delete Files
del hello.txt
View properties of modified files
arrrib hello.txt
- A:表示存档文件
- R:表示只读文件
- S:表示系统文件
- H:表示隐藏文件
Turn 1.txt into a read-only file
attrib +R hello.txt
type command
type 1.txt
: Display the contents of 1.txt
Network commands
View the system port opening status
netstat -an
Add users and member groups to which users belong
net user hello password /add
: Add user hello, password is password
Change hello to administrator
net local group administrators hello /add