1.wget Command Network application
The wget command is used to download files from the specified URL. Wget is very stable, it in the bandwidth is very narrow and unstable network has a strong adaptability, if it is because of network download failure, wget will continue to try, until the entire file download is complete. If the server interrupts the download process, it will again be linked to the server to continue downloading from where it stopped. This is useful for downloading large files from servers that have limited link times.
Grammar
wget (option) (parameter)
Options
-a< log file;: Record the execution of data in the specified log file;
-a< suffix name;: Specifies the suffix name of the file to be downloaded, separated by commas between multiple suffix names;
-B: Run the wget in the background mode;
-b< connection address;: Set the base address of the referenced connection address;
-C: Continue to perform the task of the last terminal;
-c< flag;: Set server data block function flag on is active, off is off, default value is on;
-D: Debug mode run instruction;
-d< Domain Name list: Set down the list of domains, between the domain name with "," separated;
-e< directive;: Executes the specified instruction as part of the file ". Wgetrc";
-H: Display instruction help information;
-i< file;: Gets the URL address to download from the specified file;
-l< directory list: Set down the directory list, multiple directories with "," separated;
-L: Only along the associated connection;
-r: Recursive download mode;
-Q: Do not display the instruction execution process;
-V: Shows the detailed execution process;
-V: Displays version information;
Parameters
URL: Download the specified URL address.
Instance
Use wget to download a single file wget http://www.linuxde.net/testfile.zip
2.netstat life order
The netstat command is used to print the status information of network systems in Linux, allowing you to learn about the network conditions of the entire Linux system.
Grammar
Netstat (option)
Options
-A or--all: Displays all sockets in the connection;
-a< network type > or--< network type;: Lists the relevant addresses in the network type connection;
-C or--continuous: Continuous listing of network status;
-C or--cache: shows the cache information of the router configuration;
-E or--extend: Displays other relevant information about the network;
-F or--fib: show fib;
-G or--groups: Displays the multi-broadcast Function group member list;
-H or--help: online help;
-I or--interfaces: Displays the Web interface information form;
-L or--listening: Displays the socket of the server in the monitor;
-M or--masquerade: Displays the spoofed network connection;
-N or--numeric: Use the IP address directly, not through the domain name server;
-N or--netlink or--symbolic: Displays the symbolic connection name of the network hardware peripheral device;
-O or--timers: Display timer;
-P or--programs: shows the program identification code and program name of the socket being used;
-R or--route: Show routing Table;
-S or--statistice: Display the network work information statistics;
-T or--tcp: shows the connection status of the TCP transport protocol;
-U or--UDP: Displays the connection status of the UDP transport protocol;
-V or--verbose: Displays the instruction execution process;
-V or--version: Displays version information;
-W or--raw: Displays the connection status of the raw transport protocol;
-X or--unix: The effect of this parameter is the same as specifying the "-A unix" parameter;
--ip or--inet: The effect of this parameter is the same as specifying the "-A inet" parameter.
Instance
Netstat-a #列出所有端口
Netstat-at #列出所有tcp端口
Netstat-au #列出所有udp端口
3.nslookup command
The nslookup command is a common domain name query tool, which is the command used to check DNS information. NSLOOKUP4 has two modes of operation, interactive mode and non-interactive mode. In interactive mode, users can query the domain name server for various types of host, domain name information, or output a list of hosts in the domain name. In non-interactive mode, users can only get specific names or required information for a host or domain name.
Enter interactive mode, directly enter the nslookup command, without any parameters, then directly into the interactive mode, at this time Nslookup will connect to the default domain name server (that is, the first DNS address of/etc/resolv.conf). or enter NSLOOKUP-NAMESERVER/IP. Enter the non-interactive mode, the direct input nslookup domain name can be.
Grammar
Nslookup (option) (parameter)
Options
-sil: No warning message is displayed.
Parameters
Domain Name: Specifies the domain name to query.
Instance
[email protected] ~]# nslookup www.linuxde.net
server:202.96.104.15
address:202.96.104.15#53
4. Host command
The host Command Host command is a common analytic domain name query tool that you can use to test whether your domain Name system is working properly.
Grammar
Host (option) (parameter)
Options
-A: Displays detailed DNS information;
-c< type;: Specifies the query type, the default value is "in";
-C: Query the complete SOA record for the specified host;
-R: When querying the domain name, do not use recursive query method;
-t< type;: Specifies the type of domain name information for the query;
-V: Displays details of instruction execution;
-W: If the domain name server does not give the response information, always wait until the domain name server gives the answer;
-w< time;: Specifies the maximum time for a domain name query, and if the domain name server does not give a response in the specified time, exit the instruction;
-4: Use IPV4;
-6: Use IPV6.
Parameters
Host: Specifies the host information to query for information.
Instance
[Email protected] ~]# host Www.linuxde.net
Www.linuxde.net is a alias for host.1.linuxde.net. Host.1.linuxde.net has address 192.168.0.3
5.who command
The WHO command is to display user information for the currently logged in system. The WHO command can be used to know that there are currently users logged into the system, and the WHO command will list the logged in account, the terminal used, the login time and the X-display from which to log in or are using.
Grammar
Who (options) (parameters)
Options
-H or--heading: Displays the header information column for each field;
-I or-u or--idle: Displays idle time, and if the user has performed any action within the first minute, it will be marked as "." If the user has not had any action for more than 24 hours, the "old" string is marked;
-M: The effect of this parameter is the same as specifying the "Am I" string;
-Q or--count: Displays only the account name and total number of logged-in systems;
-S: This parameter ignores non-processing and is only responsible for resolving compatibility issues with other versions of the WHO Directive;
-W or-t or--MESG or--message or--writable: Displays the user's information status bar;
--help: Online Help;
--version: Displays version information.
Parameters
File: Specifies the query file.
Instance
[email protected] ~]# who
Root pts/0 2016-4-23 9:04 (192.168.0.2)
Root PTS/1 2013-4-23 17:37
6.chage
The Chage command is used to modify the expiration date of the account and password.
Grammar
chage [Options] User name
Options
-M: The minimum number of days the password can be changed. At zero, the password can be changed at any time.
-M: The maximum number of days the password remains valid.
-W: The number of days before the user's password expires before the warning message is received.
-E: The date when the account expires. This account will not be available after this day.
-D: The date of the last change.
-I: Stasis period. If a password has expired these days, then this account will not be available.
-L: Example the current setting. By non-privileged users to determine when their password or account expires.
Instance
[Email protected] zhangsan]# chage-l root
Last password change:apr 18, 2016
Password Expires:never
Password Inactive:never
Account Expires:never
Minimum number of days between password change:0
Maximum number of days between password change:99999
Number of days of warning before password expires:7
[Email protected] zhangsan]# chage-l Zhangsan
Last password change:apr 19, 2016
Password Expires:never
Password Inactive:never
Account Expires:never
Minimum number of days between password change:0
Maximum number of days between password change:99999
Number of days of warning before password expires:7
7. Eject
The eject command is used to exit the pull-out device. If the device is already mounted, the eject command will first dismount the device before exiting. Eject allows removable media (typically CD-ROMs, floppy disks, tapes, or Jaz and zip disks) to eject under software control. The command can also control some multi-disc CD-ROM controllers, control the auto-eject feature supported by some devices, and control the shutdown of some CD-ROM drive disk trays. The device corresponding to name will be ejected, name can be a device file or its mount point, or it can be a full path or omit the previous/dev or/mnt device file name. If name is not specified, CDROM is used by default. There are four different pop-up methods, depending on whether the device is a CD-ROM, SCSI device, removable floppy disk, or tape. The default pop-up will try all four methods in turn until it succeeds. If the device is currently mounted, uninstall it before ejecting.
8.alias command
The alias command is used to set the aliases of the directives. We can use this command to simplify some of the longer commands. When using alias, the user must use the single quote ' ' to cause the original command to be used to prevent special characters from causing an error. The alias command is only limited to the login operation. To be able to use these command aliases every time you log in, you can store the alias command in Bash's initialization file,/ETC/BASHRC.
Grammar
Alias (option) (parameter)
Options
-P: Prints the command aliases that have been set.
Parameters
Command alias settings: Defines the command alias, in the format "command alias = ' actual Command '".
Instance
[Email protected] zhangsan]# alias-p
Alias cp= ' Cp-i '
Alias l.= ' ls-d. *--color=auto '
Alias ll= ' Ls-l--color=auto '
Alias ls= ' ls--color=auto '
Alias mv= ' Mv-i '
Alias rm= ' Rm-i '
Alias Which= ' Alias | /usr/bin/which--tty-only--read-alias--show-dot--show-tilde '
9.xargs command
The Xargs command is a filter that passes parameters to other commands, and is also a tool for combining multiple commands. It specializes in translating standard input data into command-line arguments, Xargs can process pipelines or stdin and convert them into command parameters for specific commands. Xargs can also convert single-line or multiline text input to other formats, such as multiline variable-order lines and single-row multiple rows. The default command for Xargs is Echo, and the space is the default delimiter. This means that the input passed to Xargs through the pipeline will contain line breaks and whitespace, but with xargs processing, line breaks and whitespace will be replaced by spaces. Xargs is one of the important components of building single-line commands. The Xargs command usage xargs is used as a replacement tool to read the output of input data reformatting.
Define a test file with multiple lines of text data:
Cat Test.txt
A b c d e F g h i j k l m n o p q R S t u v w x y Z
Multiline input single-line output: Cat Test.txt | Xargs
A b c d e F g h i j k l m n o p q R S t u v w x y Z
-N option multi-line output: Cat Test.txt | Xargs-n3
A b C
D E F
G h I
J K L
10.yum
The Yum command package Management Yum command is a RPM-based package manager in Fedora and Redhat as well as SUSE, which enables system administrators to interact and automate finer and more granular management of RPM packages, to automatically download RPM packs from specified servers and install them, Dependency relationships can be automatically handled and all dependent software packages are installed at once, without the hassle of downloading and installing them over and over again. Yum provides commands to find, install, and delete one, a group, or even all of the packages, and the commands are concise and well-remembered.
Grammar
Yum (option) (parameter)
Options
-H: Display Help information
;-Y: Answer "yes" to all questions;
-C: Specify the configuration file;
-Q: Quiet mode;
-V: Verbose mode;
-D: Set debug Level (0-10);
-E: Set error level (0-10);
-R: Sets the maximum wait time for Yum to process a command;
-C: Run completely from the cache without downloading or updating any header files.
Parameters
Install: Installing the RPM software package;
Update: Updated RPM software package;
Check-update: Check if there is an updated RPM package available;
Remove: Deletes the specified RPM software package;
List: Displays information about the package;
Search: Check the software package for information;
Info: Displays descriptive information and summary information for the specified RPM package;
Clean: Cleans up the stale cache of Yum;
Shell: Enter the Yum shell prompt;
RESOLVEDEP: Shows the dependencies of RPM packages;
Localinstall: Install the local RPM software package;
Localupdate: Display local RPM package for update;
Deplist: Displays all dependencies of the RPM package.
Linux common commands (ii)