CMD common commands

Source: Internet
Author: User
Tags exit in ftp commands ftp connection remote ftp server runique

Win7 Run command

Win+r, is to run the command shortcut key. The following 3 must know:


Ping It is a command to check whether the network is unobstructed or the speed of the network connection. As an administrator or hacker living on the network, the ping command is the first DOS command that must be mastered, and it uses the same principle: the machine on the network has a unique IP address, we send a packet to the destination IP address, and the other party returns a packet of the same size. According to the returned packets we can determine the existence of the target host, can initially determine the target host operating system and so on. Here's a look at some of its most common operations. Let's take a look at the Help, type in the DOS window: ping/? Enter. The Help screen shown.     Here, we only have some basic useful parameters to be able to (the same below). -T means that packets will be sent uninterrupted to the destination IP until we force it to stop.     Imagine, if you use 100M broadband access, and the target IP is 56K kitten, then it will not be long, the target IP is not able to withstand so much data and dropped, hehe, an attack is so simple to achieve. -L defines the size of the sending packet, which defaults to 32 bytes, which we can use to define the maximum to 65500 bytes.     Combined with the-t parameter described above, there will be a better effect oh. -N defines the number of times a packet is sent to the destination IP, which defaults to 3.     If the network speed is slow, 3 times for us also wasted a lot of time, because now our goal is only to determine whether the target IP is present, then define it as a time. Note that if the-t parameter is used with the-n parameter, the ping command is standard with the following parameters, such as "Ping Ip-t-N 3", although the-t parameter is used, but it is not ping all the time, but only 3 pings.     In addition, the ping command does not have to ping the IP, you can ping the host domain name directly, so that you can get the host's IP.     Let's give an example to illustrate the usage. Here time=2 indicates that the time taken from sending a packet to receiving a return packet is 2 seconds, from which you can determine the size of the network connection speed. The return value from the TTL can be initially judged by the Ping host's operating system, the reason is that the "preliminary judgment" is because this value can be modified.  Here ttl=32 indicates that the operating system may be win98. (Tip: If ttl=128, the target host may be Win2000; if ttl=250, the target host may be Unix) as for the use of the ping command to quickly find LAN fault, you can quickly search the fastest QQ server, you can ping other people to attack ... It's all on the people's own play.


Ftp You should be more familiar with this order, right? There are many open FTP hosts on the network, a large part of which is anonymous, which means anyone can log in. Now if you sweep to a host that has an open FTP service (typically a 21-port machine), what if you don't use the FTP command?  The following is a basic way to use the FTP command.     Start by typing the FTP carriage return at the command line with the prompt for the FTP, and you can type "help" to view assistance (any DOS command can use this method to view its help). As you may see, how do you use so many commands?     In fact, there is not so much to master a few basic is enough. The first is the landing process, which will be used to open, directly in the FTP prompt input "Open host IP FTP port" Enter, the general port is 21 by default, you can not write.     Then enter a valid user name and password to login, here with anonymous FTP as an example introduced. The user name and password are FTP, and the password is not displayed. When prompted * * * * logged in, it means the login is successful.     The user is shown as anonymous because it is logged anonymously.     The next step is to introduce how to use the specific commands.  Dir is the same as the DOS command, used to view the server files, directly hit Dir Enter, you can see the file on this FTP server.  CD into a folder.  Get download file to local machine. Put to upload files to the remote server.  This depends on whether the remote FTP server has given you permission to write, if you can, hehe, how to use it is not much to say, we will freely play to it. Delete Deletes the files on the remote FTP server.  This must also ensure that you have writable permissions.  Bye exits the current connection. Quit ditto.


TelnetPowerful remote login command, almost all intruders like to use it, always tried. Why? It is easy to operate, just like using your own machine, as long as you are familiar with DOS commands, you can use it to do everything you want to do after you have successfully connected the remote machine as a administrator.     Here's how to use it, first type Telnet carriage return, and then type help to view its helpful information.     Then at the prompt type open IP Enter, then there is a login window, let you enter a valid user name and password, here to enter any password is not displayed. When you enter the user name and password are correct after the successful establishment of the Telnet connection, this time you on the remote host with the same permissions as this user, the use of DOS commands to achieve what you want to do. Here I use Super admin privileges to log on.

The others are:
Shutdown-------60-second Countdown shutdown command
Notepad--------Open Notepad
Calc-----------Start Calculator
Taskmgr-----Task Manager (2000/XP/2003)
Write----------WordPad
MSPaint--------Drawing Board
MSTSC----------Remote Desktop Connection
Cmd.exe--------cmd command prompt
Netstat-a See which ports are open, common Netstat-an
Netstat-n View Port network connectivity, common Netstat-an


Ping IP (or domain name) sends the default size of 32 bytes of data to the host, parameter: "-l[space" packet size ";"-N Send data Number ";"-T "means to ping all the time.
Ipconfig (winipcfg) for Windows NT and XP (Windows 95 98) To view the local IP address, ipconfig the available parameters "/all" To display all configuration information
Telnet IP port far and landing server, default port is 23
Open IP connection to IP (after telnet login command)
Telnet directly on this computer telnet will enter the native Telnet
Copy path file name 1 path file name 2/y Copy the file 1 to the specified directory is file 2, with the parameter/y to cancel the confirmation you want to overwrite an existing directory file
xcopy to copy files or directory tree destination address directory name copy file and directory tree, with parameter/y will not prompt overwrite same file
Use the parameter/E to copy subdirectories under the directory together to the destination address.
Tftp-i own IP (using meat machine as a springboard when this with meat machine IP) get Server.exe C:server.exe after landing, the "IP" Server.exe download to the target host C:server.exe parameters:-I refers to the binary mode of transmission, If the exe file is transferred, if not plus-I is transmitted in ASCII mode (transfer text file mode)
Tftp-i the other IP put C:server.exe login, upload the local c:server.exe to the host
The FTP IP port is used for uploading files to the server or for file operations, and the default port is 21. Bin refers to binary mode (executable file); The default is ASCII format (when text files are sent)
Dir view file, Parameters:/q Display file and directory belongs to the system which user,/T:C display file creation time,/t:a show the last time the file was accessed,/t:w last modified time
date/t, time/t using this parameter, "date/t", "time/t" will display only 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 set environment variable
Set shows all the current environment variables
Set P (or other character) displays all environment variables currently starting with the character P (or other characters)
Echo information Displays information on the screen
Find filename finds a file
Title Title name change cmd window title name
A color color value sets the cmd console foreground and background color; 0 = black, 1 = blue, 2 = green, 3 = Light green, 4 = red, 5= violet, 6 = yellow, 7 = white, 8 = Gray, 9 = blue, a= green, b= light aqua, c= red, d= light purple, e= yellow, f= bright white
Prompt name change cmd.exe display command prompt (change C:, D: Unified to: Entsky)
MD Directory Name creation directory
Replace the file's directory replacement file to replace the source file
Tree displays a table of contents, with parameter-F to list the file names in the first folder
Type file name Displays the contents of the text file
More file name display output file by screen
Taskmgr Bring up Task Manager
  

    • New commands under Win2003 System (Practical section):
Shutdown/Parameters Close or restart the local or remote host.
Parameter description:/S shutdown host,/R restart host,/T number set delay time, range between 0-180 seconds,/A Cancel boot,/M//IP specified remote host. Example: SHUTDOWN/R/T 0 restart the local host immediately (no delay)
TASKLIST Displays the process identifier (PID) of processes, services, and services that are currently running on local and remote hosts.
Parameter description:/M lists the DLL files that are loaded by the current process,/SVC displays the services for each process, and lists only the current processes without parameters.
    • Basic commands under Linux system Note: to differentiate case
Uname display version information (same as Win2K ver)
DIR Displays the current directory file, Ls-al display includes hidden files (dir with Win2K)
PWD Query the directory location where you are currently located
CD CD. Go back to the previous level and note the CD with the. There are spaces between them. CD/Return to the root directory.
Cat file name view file contents
Cat >abc.txt The contents of the Abc.txt file.
More file names display a text file in a page-by-page fashion.
CP Copy File
MV Moving files
RM file name Delete file, rm-a directory name delete directory and subdirectories
mkdir Directory name creation directory
RmDir Delete subdirectories, there are no documents in the directory.
chmod setting access rights to files or directories
Grep finds a string in the archive
Diff file Comparison
Find Archive Search
Date, time of day
Who queries the person who is currently using the same machine as you and the login time location
W Query the details of the current person on the machine
WhoAmI to see your account name
Groups to see someone's group
passwd Change Password
History View the commands you've been under
PS Display process Status
Kill stops a process
GCC hackers usually use it to compile files written in C language.
The SU permission is converted to the specified consumer
Telnet IP Telnet connects to the other host (same as Win2K), indicating that the connection was successful when bash$ was present.
FTP FTP connection on a server (same as Win2K)


    • FTP command
FTP commands are important both in the Linux system and in the window System. Below I have detailed a copy of the FTP command, the top 16 most commonly used.
The command line format for FTP is:
Ftp-v-d-i-n-g [host name], where
-V Displays all response information for the remote server
-N Limit FTP automatic login, that is, do not use;. n etrc file;
-d use debug mode;
-G cancels the global file name.
    • The internal commands used by FTP are as follows (the brackets indicate the optional options):
The most commonly used are as follows:
01.CD Remote-dir: Enter the remote host directory.
02.cdup: Enter the parent directory of the remote host directory.
03.pwd: Displays the current working directory of the remote host.
04.LCD[DIR]: Switch the local working directory to dir.
05.dir[remote-dir][local-file]: Displays the remote host directory and stores the results in a local file.
06.ls[remote-dir][local-file]: Displays the remote directory Remote-dir and stores the local file Local-file.
07.delete remote-file: Delete the remote host file.
08.get remote-file[local-file] (download): Transfer the remote host's file Remote-file to the local-file of the local hard disk.
09.put Local-file[remote-file] (upload): Transfers the local file Local-file to the remote host.
10.mget remote-files: Transfer multiple remote files.
11.mput local-file: Transfers multiple files to a remote host.
12.prompt: Interactive tips for setting up multiple file transfers.
13.bin: Use a binary file transfer method.
14.close: Interrupts the FTP session with the remote server (corresponding to open).
15.quit: With bye, exit the FTP session.

    • The others include:
! [Cmd[args]]: Perform interactive shell,exit in the local machine back to the FTP environment, such as:!ls*.zip
. $ Macro-ame[args]: Perform macro definition macro-name.
Account[password]: Provides the supplemental password required to access system resources after a successful logon to the remote system.
Append Local-file[remote-file]: Appends the local file to the remote system host and uses the local file name if the remote system file name is not specified.
ASCII: Uses the ASCII type transfer method.
Bell: The computer rings once after each command has been executed.
Case: When using Mget, capitalize the remote host file name into lowercase letters.
chmod mode file-name: Sets the remote host file File-name access mode to mode, such as: chmod 777 a.out.
CR: When transferring a file using Asscii, the carriage return line is converted to a return line.
Debug[debug-value]: Set debug mode, display each command sent to the remote host, such as: Deb up 3, if set to 0, means cancel Debug.
Disconnection: With close.
Form format: Sets the file transfer mode to format, which is the default.
Glob: Sets the file name extension of Mdelete,mget,mput, by default does not extend the file name, the same as the command line-G parameter.
Hash: 1024 bytes per transmission, showing a hash symbol (#).
Help[cmd]: Displays help information for the FTP internal command cmd, such as: get.
Idle[seconds]: Set the remote server's sleep timer to [seconds] seconds.
Image: Sets the binary transfer mode (same binary).
Macdef Macro-name: Defines a macro that ends when an empty row under Macdef is encountered.
Mdelete[remote-file]: Delete the remote host file.
Mdir remote-files Local-file: Similar to dir, but can specify multiple remote files, such as: Mdir *.o.*.zipoutfile.
mkdir dir-name: Build a directory in the remote host.
MLS Remote-file Local-file: Same as nlist, but multiple file names can be specified.
Mode[modename]: Set the file transfer mode to Modename, the default is stream mode.
Modtime file-name: Displays the last modified time of the remote host file.
Newer file-name: If the File-name modification time in the remote machine is closer than the time of the local hard disk file, the file is re-transmitted.
Nlist[remote-dir][local-file]: Displays the list of files for the remote host directory and deposits the local-file of the local hard disk.
Nmap[inpattern Outpattern]: Sets the file name Mapping mechanism, so that when files are transferred, some characters in the file are converted to each other, such as: Nmap $1.$2.$3[$1,$2]. [$2,$3], when the file a1.a2.a3 is transferred, the filename becomes a1,a2. This command is especially useful for cases where the remote host is not a UNIX machine.
Ntrans[inchars[outchars]]: Sets the translation mechanism of the filename character, such as NTRANS1R, the file name lll becomes the RRR.
Open Host[port]: establishes the specified FTP server connection and can specify the connection port.
Passive: Enter passive transmission mode.
Proxy Ftp-cmd: In the secondary control connection, execute an FTP command that allows you to connect two FTP servers to transfer files between two servers. The first FTP command must be open to establish a connection between two servers first.
Quote Arg1,arg2 ... : The parameters are sent verbatim to the remote FTP server, such as: Quote Syst.
Recv Remote-file[local-file]: Same as get.
Reget Remote-file[local-file]: similar to get, but if local-file exists, it is resumed from the last transmission interrupt.
Rhelp[cmd-name]: Request help for remote host.
Rstatus[file-name]: If the file name is not specified, the status of the remote host is displayed, otherwise the file status is displayed.
Rename[from][to]: Change the remote host file name.
Reset: Clears the answer queue.
Restart marker: From the specified flag marker, restart get or put, such as: Restart 130.
RmDir dir-name: Deletes the remote host directory.
Runique: Set file name only one sex store, if the file exists, then add suffix after the original file. 1,. 2, etc.
Send Local-file[remote-file]: same put.
SendPort: Sets the use of the port command.
Site Arg1,arg2 ... : sends the parameter verbatim to the remote FTP host as the site command.
Size File-name: Displays the remote host file size, such as: Site Idle 7200.
Status: Displays the current FTP status.
Struct[struct-name]: Sets the file transfer structure to struct-name, using the stream structure by default.
Sunique: Sets the remote host file name store to only one (corresponding to Runique).
System: Displays the type of operating system for the remote host.
Tenex: Set the file Transfer type to the desired type of the Tenex machine.
TICK: Sets the byte counter at transfer time.
Trace: Sets the package trace.
Type[type-name]: Set the file Transfer type to Type-name, default to ASCII, such as: Type binary, set the binary transfer mode.
Umask[newmask]: Set the remote server's default umask to Newmask, such as: Umask 3
User User-name[password][account]: to indicate your identity to a remote host, you must enter a password when you need a password, such as: User anonymous [email protected].
Verbose: With the command line, the-v parameter, which is set for detailed reporting, all the responses of the FTP server are displayed to the user, by default, on.
    • MySQL command

To start with the MySQL command, you must add the MySQL bin directory to the path variable. I personally prefer to use the Wamp integrated MySQL integration tool, which is very handy, and also comes with a command window. I added C:\wamp\bin\mysql\mysql5.6.17\bin to the path, so I could use the MySQL command in the cmd window.


There are 2 ways to connect to MySQL (if you just installed MySQL, Superuser Root does not have a password, you can normally use MySQL on your own computer to hit MySQL directly):
1,mysql-h host Address-u user name-p password; (example: Mysql-h 127.0.0.1-u root-p)
2,mysql-p Password-u username-H host address, (example: mysql-p-u root-h 127.0.0.1)
(Note: U and root can be used without spaces, and others are the same)
Exiting MySQL is simple: Exit or quit
The following are commonly used SQL statements, will be in the collation of the database at the time to do a detailed introduction, there is not much to repeat.
Mysqladmin-u username-p Old password password new password change password
show databases; Displays the list of databases. Just started with two databases: MySQL and test. MySQL Library is very important it has the MySQL system information, we change the password and the new user, is actually using this library to operate.
Use MySQL;
Show tables; Displaying data tables in a library
describe table name; Show the structure of a data table
Create database name; Build Library
Use library name;
CREATE TABLE table name (field settings list);
drop database name;
drop table name, delete library and delete table
Delete from table name; Empty records in a table
SELECT * from table name; Show records in a table

CMD common commands

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.