7 lệnh CMD dân IT cần phải biết

lynhaan.khang

New member
### 7 lệnh CMD cần biết

** #it #cmd #Commands #Tech #sysadmin **

** 1. ** ** DIR **

Lệnh ** Dir ** liệt kê các tệp và thư mục trong một thư mục.Đây là một trong những lệnh CMD cơ bản nhất và nó được sử dụng để nhanh chóng nhận được danh sách các tệp trên hệ thống của bạn.

** Cú pháp: **

`` `
Dir [Drive:] [Path] [/a] [/o] [/s] [/b] [/l] [/q] [/w]
`` `

**Thông số:**

*** Ổ đĩa: ** Bỏ ổ đĩa của thư mục bạn muốn liệt kê.
*** Đường dẫn: ** Đường dẫn đến thư mục bạn muốn liệt kê.
***/A: ** Liệt kê các tệp và thư mục với các thuộc tính được chỉ định.
***/o: ** Sắp xếp danh sách theo các tiêu chí được chỉ định.
***/s: ** Liệt kê các tệp và thư mục trong tất cả các thư mục con của thư mục được chỉ định.
***/B: ** Liệt kê các tệp và thư mục ở định dạng trần.
***/L: ** Liệt kê các tệp và thư mục bằng chữ thường.
***/Q: ** Liệt kê các tệp và thư mục không có thuộc tính của chúng.
***/W: ** Liệt kê các tệp và thư mục ở định dạng rộng.

**Ví dụ:**

`` `
Dir C: \ Windows
`` `

Lệnh này sẽ liệt kê tất cả các tệp và thư mục trong thư mục C: \ Windows.

** 2. ** ** CD **

Lệnh ** CD ** thay đổi thư mục hiện tại.Nó được sử dụng để điều hướng giữa các thư mục trên hệ thống của bạn.

** Cú pháp: **

`` `
CD [Drive:] [Path]
`` `

**Thông số:**

*** Ổ đĩa: ** Bỏ học của thư mục bạn muốn thay đổi.
*** Đường dẫn: ** Đường dẫn đến thư mục bạn muốn thay đổi.

**Ví dụ:**

`` `
CD C: \ Windows \ System32
`` `

Lệnh này sẽ thay đổi thư mục hiện tại thành thư mục C: \ Windows \ System32.

** 3. ** ** Sao chép **

Lệnh ** Sao chép ** sao chép các tệp và thư mục từ vị trí này sang vị trí khác.Đó là một lệnh rất linh hoạt có thể được sử dụng để sao chép các tệp vào các ổ đĩa, thư mục khác nhau và thậm chí cho các máy tính khác nhau.

** Cú pháp: **

`` `
Sao chép [Nguồn] [đích] [/a] [/b] [/e] [/i] [/k] [/l] [/n] [/o] [/p] [/q] [/r] [/S] [/t] [/u] [/v] [/w]
`` `

**Thông số:**

*** Nguồn: ** Đường dẫn đến tệp hoặc thư mục bạn muốn sao chép.
*** Đích: ** Đường dẫn đến vị trí mà bạn muốn sao chép tệp hoặc thư mục.
***/A: ** Sao chép các tệp với bộ thuộc tính lưu trữ.
***/B: ** Sao chép các tệp ở chế độ nhị phân.
***/E: ** Bản sao thư mục và thư mục con, ngay cả khi chúng trống rỗng.
***/i: ** ghi đè các tệp hiện có mà không cần nhắc.
***/k: ** Bản sao các thuộc tính tệp.
***/l: ** liệt kê các tệp sẽ được sao chép mà không thực sự sao chép chúng.
***/n: ** Tạo các tệp mới có cùng tên với các tệp gốc, nhưng với một số được nối vào cuối.
***/o: ** Ghi đè các tệp chỉ đọc mà không cần nhắc.
***/P: ** Lời nhắc trước khi ghi đè lên các tệp hiện có.
***/Q: ** Chế độ yên tĩnh.Ngăn chặn tất cả đầu ra.
***/r: ** Sao chép các thư mục và thư mục con đệ quy.
***/s: ** Sao chép các tệp từ các thư mục con.
***/t: ** Sao chép các dấu thời gian tệp.
***/u: ** Chỉ các bản sao các tệp mới hơn các tệp đích.
***/V: ** Xác minh rằng các tệp đã được sao chép thành công.
***/W: ** Chờ một nhân vật trước khi tiếp tục.

**Ví dụ:**

`` `
Sao chép C: \ Windows \ System32 \ notepad.exe C: \ Tệp chương trình \
`` `

Lệnh này sẽ sao chép tệp notepad.exe từ thư mục C: \ Windows \ System32 sang thư mục Files C: \ Program Files.
=======================================
### 7 CMD commands IT need to know

**#IT #cmd #Commands #Tech #sysadmin**

**1.** **DIR**

The **DIR** command lists the files and folders in a directory. It is one of the most basic CMD commands, and it is used to quickly get a listing of the files on your system.

**Syntax:**

```
DIR [drive:][path] [/A] [/O] [/S] [/B] [/L] [/Q] [/W]
```

**Parameters:**

* **drive:** The drive letter of the directory you want to list.
* **path:** The path to the directory you want to list.
* **/A:** Lists files and folders with the specified attributes.
* **/O:** Sorts the list by the specified criteria.
* **/S:** Lists files and folders in all subdirectories of the specified directory.
* **/B:** Lists files and folders in a bare format.
* **/L:** Lists files and folders in lowercase.
* **/Q:** Lists files and folders without their attributes.
* **/W:** Lists files and folders in wide format.

**Example:**

```
DIR C:\Windows
```

This command will list all of the files and folders in the C:\Windows directory.

**2.** **CD**

The **CD** command changes the current directory. It is used to navigate between directories on your system.

**Syntax:**

```
CD [drive:][path]
```

**Parameters:**

* **drive:** The drive letter of the directory you want to change to.
* **path:** The path to the directory you want to change to.

**Example:**

```
CD C:\Windows\System32
```

This command will change the current directory to the C:\Windows\System32 directory.

**3.** **COPY**

The **COPY** command copies files and folders from one location to another. It is a very versatile command that can be used to copy files to different drives, folders, and even to different computers.

**Syntax:**

```
COPY [source] [destination] [/A] [/B] [/E] [/I] [/K] [/L] [/N] [/O] [/P] [/Q] [/R] [/S] [/T] [/U] [/V] [/W]
```

**Parameters:**

* **source:** The path to the file or folder you want to copy.
* **destination:** The path to the location where you want to copy the file or folder.
* **/A:** Copies files with the archive attribute set.
* **/B:** Copies files in binary mode.
* **/E:** Copies directories and subdirectories, even if they are empty.
* **/I:** Overwrites existing files without prompting.
* **/K:** Copies file attributes.
* **/L:** Lists the files that would be copied without actually copying them.
* **/N:** Creates new files with the same name as the original files, but with a number appended to the end.
* **/O:** Overwrites read-only files without prompting.
* **/P:** Prompts before overwriting existing files.
* **/Q:** Quiet mode. Suppresses all output.
* **/R:** Recursively copies directories and subdirectories.
* **/S:** Copies files from subdirectories.
* **/T:** Copies the file timestamps.
* **/U:** Only copies files that are newer than the destination files.
* **/V:** Verifies that the files were copied successfully.
* **/W:** Waits for a character before continuing.

**Example:**

```
COPY C:\Windows\System32\notepad.exe C:\Program Files\
```

This command will copy the notepad.exe file from the C:\Windows\System32 directory to the C:\Program Files directory.
 
Join ToolsKiemTrieuDoGroup
Back
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock