Common DOS Commands

Source: Internet
Author: User
Tags clear screen

Common DOS command set:

Dir column file name deltree Delete directory tree CLS clear screen CD change current directory
Copy copy file diskcopy copy disk del delete file format Disk
Edit text edit mem view memory status MD create subdirectory Move file, change Directory Name
More split screen display type display file content RD Delete directory sys create DOS system disk
Rename change file name xcopy copy directory and file chkdsk check disk attrib set file attribute
Fdisk hard disk partition date display and modification date label set volume label defrag disk Fragment
MSD system detection path setting search directory share file sharing memmaker Memory Optimization Management
Help restore backup file set environment variable time display and modification time
Tree column directory tree debug random debug program doskey re-call DOS to make prempt setup prompt undelete restore deleted files Scandisk detection, Repair Disk

Doscommands are not commonly used.
Diskcomp disk comparison append setting non-executable file path
Expand restores the DOS file fasthelp to quickly display help information
FC file comparison interink start server
Setver sets intersvr to start the client
Replacing the qBASIC integration environment with the SUBST path
Vsafe anti-virus unformat restore a formatted disk
Ver displays DOS version number smartdrv sets disk accelerator
Vol display disk volume number LH mount program into high-end memory
Ctty change control device emm386 extended memory management

I. dir

Displays the list of directory files and subdirectories.
You can use wildcards (? And *),? One character for a table, and * any character for a table
*. Suffix
Specifies the file whose suffix you want to view. The above can also be ". suffix", for example, dir *. EXE is equal to Dir. exe
/P
A list screen is displayed each time. To view the next screen, press any key on the keyboard.
/W
Display the list in wide format. A maximum of five file names or directory names can be displayed on each line.
/S
Lists the names of each specified file in a specified directory and all subdirectories. It is much faster than searching in win environment
Dir *. *-> a.txt: Write the current directory file into a.txt.
Dir *. */S-> a.txt writes the current directory file into a.txt, including the files in subdirectories.

Ii. attrib

Display, set, or delete read-only, archived, system, and hidden attributes assigned to a file or directory. If this parameter is not included, attrib displays the attributes of all files in the current directory.
+ R
Set the read-only attribute.
-R
Clear read-only attributes.
+
Set the attributes of an archive file.
-
Clear the attributes of an archive file.
+ S
Set system properties.
-S
Clear system properties.
+ H
Set hidden attributes.
-H
Clear hidden attributes.
Iii. CLs

Clear all information displayed in the Command Prompt window, and return to the empty window, that is, "clear screen"

Iv. Exit
Exit the current command interpreter and return to the system.

V. Format
Format
/Q
Execute quick formatting. Delete the file table and root directory of the previously formatted volume, but do not scan the damaged area between slices. Use the/Q command line option to format only the previously formatted intact volumes.

Vi. ipconfig
Displays all current TCP/IP network configuration values, refresh Dynamic Host Configuration Protocol (DHCP), and Domain Name System (DNS) settings. You can use ipconfig without parameters to display the IP addresses, subnet masks, and default gateways of all adapters.
/All
Displays the complete TCP/IP configuration information for all adapters.
Ipconfig is equivalent to winipcfg, which is available on me, 98, and 95. Although Windows XP does not provide a graphical interface like the winipcfg command, you can use "network connection" to view and update IP addresses. To do this, open a network connection, right-click a network connection, click status, and then click the support tab.
This command is most suitable for computers configured to automatically obtain IP addresses. It allows you to determine which TCP/IP configuration values are configured by DHCP, automatic private IP address (apipa), and other configurations.

VII. md
Create a directory or subdirectory

8. Move
Moves one or more files from one directory to the specified directory.

IX. NBTSTAT
Displays NetBIOS statistics, NetBIOS name table, and NetBIOS name cache for local and remote computers based on the TCP/IP protocol. NBTSTAT can refresh the NetBIOS name cache and the registered Windows Internet Name Service (WINS) Name. Use NBTSTAT without parameters to display help. The nbtstat command line parameters are case sensitive.
-A remotename
The NetBIOS name table of the remote computer is displayed. remotename is the name of the remote computer NetBIOS.
-A IPaddress
The NetBIOS name table of the remote computer is displayed, which is specified by the IP address of the remote computer (separated by decimal points ).

10. netstat
Displays active TCP connections, computer listening ports, Ethernet statistics, IP Route tables, and IPv4 statistics (for IP, ICMP, TCP, and UDP protocols) and IPv6 statistics (for IPv6, ICMPv6, TCP over IPv6, and UDP over IPv6 ). If no parameter is required during use, netstat displays the active TCP connection.
-
Display All active TCP connections and TCP and UDP ports listened by the computer.
11. Ping
Verify the IP-level connection with another TCP/IP computer by sending an ICMP echo request message. The received response message is displayed along with the number of round-trip requests. Ping is the main TCP/IP command used to detect network connectivity, accessibility, and name resolution problems. If no parameter exists, ping the command to display help. Name and IP address resolution are the simplest and most commonly used applications.
-T
Specify that the Ping can continuously send the echo request information to the destination before the interruption. To interrupt and display statistics, press Ctrl-break. To interrupt and exit Ping, press Ctrl-C.
-Lsize
Specify the length (in bytes) of the "data" field in the Response Request Message sent ). The default value is 32. The maximum size is 65,527.

12. Rename (ren)
Change the file name.
For example, Ren *. ABC *. CBA

13. Set
Display, set, or delete environment variables. If no parameter exists, the set command displays the current environment settings.

14. Shutdown
Allows you to disable or restart a local or remote computer. If no parameter is used, shutdown logs out of the current user.
-M computername
Specify the computer to close.
-T xx
Set the timer used for system shutdown to XX seconds. The default value is 20 seconds.
-L
Log out of the current user. This is the default setting. -M computername is preferred.
-S
Disable the local computer.
-R
Shut down and restart.
-
Stop and close. Except-L and computername, other parameters are ignored. During the timeout period, you can only use-.

15. System File Checker (SFC)
In Windows, all protected system files are scanned and verified after the computer is restarted.
/Scannow
Scan all protected system files immediately.
/Scanonce
Scan all protected system files at a time.
/Purgecache
Immediately clear the "Windows File Protection" File Cache and scan all protected system files.
/Cachesize = x
Sets the cache size of the "Windows File Protection" file, in MB.

16. Type
Displays the content of a text file. Use the type command to view text files or BAT files without modifying the files

17. Tree
Visualizes the display path or the directory structure of the disk in the drive.

Xcopy
Copy files and directories, including subdirectories.
/S
Copy non-empty directories and subdirectories. If/s is omitted, xcopy will work in a directory.
/E
Copy all subdirectories, including empty directories.

19. Copy
Copy one or more files from one location to another

20. DEL
Deletes a specified file.
FTP and bat batch commands and net and telnet are not mentioned here because there are too many sub-commands, but these are commonly used.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.