Windows (DOS) basic operation

Windows (DOS) basic operation

File commands

Switch directory command:

cd C:\test
1

Create a directory:

md file

We create file1and file2two directories in the file

  • First switch the directory into the file directorycd file

  • Create file1 and file2 directories md file1 fil2

2
Insert picture description here

Display file list:

dir
Insert picture description here

Modify the file name:

ren

Modify file-> file1-> hello.txt to world.txt

  • cd file1
  • ren hello.txt world.txt
    Insert picture description hereInsert picture description here

Delete a directory or file:

rd

Delete file1 directory

  • Return to the directory above file1cd ..

  • tryrd file1

    Prompts that there is a file in file1 and cannot be deleted

    Attempt rd /s /q file1to delete (deletion successful)

    /s Deleting in quiet mode, without displaying to the user to see if the directory is empty, and delete directly.
    Insert picture description here

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)
Insert picture description here

Move file

move hello.txt c:\

Delete Files

del hello.txt

View properties of modified files

arrrib hello.txt
Insert picture description here

 - A:表示存档文件
 - R:表示只读文件
 - S:表示系统文件
 - H:表示隐藏文件

Turn 1.txt into a read-only file

attrib +R hello.txt

Insert picture description here

type command

type 1.txt: Display the contents of 1.txt
Insert picture description here

Network commands

View the system port opening status

netstat -an
Insert picture description here

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

Published 22 original articles · Likes0 · Visits 794

Guess you like

Origin blog.csdn.net/sjxgghg/article/details/105225817