Linux summary 2

Source: Internet
Author: User
Tags nameserver
1

Command replacement is similar to redirection, but the difference is that command replacement uses the output of one command as the parameter of another command. Common command formats:
Command1 'command2'
The output of command2 is used as the parameter of command1. Note that the 'symbol is used as the command execution, and the execution result is used as the command1 parameter.
For example:
$ CD 'pwd'
The command uses the directory listed by the PWD command as the parameter of the CD command, and the result remains in the current directory. 2 find/home-user Jacky find file 3 wheris ls of Jacky in/home to find Executable File Path 4 DF-H view Partition
Du-H/etc/services: view disk space occupied by a directory
5 rpm-Qa | grep ftp: Check if FTP is installed. 6. Last, the last user logged in is displayed.
Lastlog is used to list the login details of each user. Top note that the upper case P can be used to sort by CPU usage. 7 Ps-l pstree-A lists the process relationships in a tree.
Add "make" and "add" to make "to the background process.
FG calls the background process to the foreground
FG process number
8. system logs are stored in
Run the dmsg command directly under/var/log/dmsg.
The error log is under/var/log/messages.
View recent logs
The following example shows how to use the tail-F/var/log/messages9 command:
(1) modify the user name and change the user name "liuyidan" to "lyd". The command used is:
# Usermod-l lyd liuyidan
(2) Lock the "lyd" user so that it cannot log on. The command is as follows:
# Usermod-l lyd
(3) unlock the "lyd" user account so that it can log on. The command is as follows:
# Usermod-u lyd10 PS output meaning
Field meaning
User: User Name of the process owner
PID process number
% Percentage of CPU time and total time used by the CPU process since the last refresh
% Memory usage percentage of MEM Process
The virtual memory size used by the vsz process, in K.
The size of the RSS resident space. Displays the number of K bytes of the current resident memory program.
Tty process-related Terminal
Stat Process status, which is given in one of the following code:
R: executable. S: sleep status. D: uninterrupted sleep. T: Stop or trace.
Z: zombie. W: The process does not have a resident page. I: idle.
Total CPU time used by the time process
Command Line
The priority value of the Ni process. A smaller number indicates that the CPU usage is low.
PRI process priority.
Ppid parent process ID
Wchan process waiting kernel event name 11 Location of common network configuration files
1. Network Settings/etc/sysconfig/Network
This file is used to specify network configuration information on the server, including parameters for controlling network-related file and daemon behavior. The following is an example file:
Networking = Yes
Hostname = machine1
Gateway = 210.34.6.2
Forward_ipv4 = Yes
Gatewaydev =
Network = yes/no indicates whether the network is configured; hostname = hostname indicates the Host Name of the server; gateway = GW-IP indicates the IP address of the Network Gateway; forward_ipv4 = yes/no whether IP Forwarding is enabled; garewaydev = GW-dev GW-DW indicates the gateway device name

Host Name/etc/hostname
This file contains the Host Name of the system, including the full domain name, such:
192.168.0.1 lb.whpu.edu.cn
This file is obtained from the hostname line in the file/etc/sysconfig/network at startup and is used to set the Host Name of the system at startup.
3. ing between IP addresses and host names/etc/hosts
The/etc/hosts file contains the ing between the IP address and the host name, as well as the host name alias. The IP address design makes it easy for the computer to recognize, but it is hard for people to remember, to solve this problem, the/etc/hosts file is created. The following is an example file.

127.0.0.1 machine1 localhost. localdomain localhost
192.168.1.100 machine7
192.168.1.101 otherpc otheralias
In this example, the local machine name is machine1, otherpc also has the alias otheralias, which can point to otheralias. Once the network configuration file of the machine is configured, restart the network to make the modification take effect. Run the following command to restart the network:
/Etc/rc. d/init. d/network restart

Ing between port numbers and server names/etc/services
/Etc/Services contains the ing between the service name and the port number. Many system programs need to use this file.

Configure name parser/etc/host. conf
The/etc/host. conf file specifies how to resolve the Host Name
3 Resolution Method:/etc/hosts, DNS, NIS
Example: Order hosts, bind
Multi on # Whether/etc/hosts allows a host to have multiple IP addresses
Configure DNS Client/etc/resolv. conf
File/etc/resolv. conf configures the DNS customer. It contains the domain name search sequence of the host and the address of the DNS server. Each line should contain one keyword and one or more parameters separated by spaces. The following is an example file:
Search mydom.edu.cn
Nameserver 210.34.0.14
Nameserver 210.34.0.2

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.