Summary of Linux operating system knowledge points (2)

Summary (1) Link to the summary of Linux operating system knowledge points (1) (with VMware, CentOS and finalshell installation tutorials)_Hello, tomorrow, blog-CSDN blog

43. Since the IP address of the Linux system of the virtual machine is obtained through the DHCP service, it will be obtained again after each restart of the device, resulting in frequent changes in the IP address.

Therefore, even if we configure the mapping relationship between the host name and the IP address under the win system, it will be frequently modified due to the change of the IP address.

How to configure fixed IP?

1. Configure the IP address gateway and network segment (IP address range) in VMware.

Specific steps: Open VMware → Edit → Virtual Network Editor → see the figure below.

2. Manually modify the configuration file in the Linux system to fix the IP.

Use vim to edit the /etc/sysconfig/network-scripts/ifcfg-ens33 file and make the following modifications.

After modifying, save and exit, and then restart the network card. 

It can be seen that our IP has changed to 192.168.25.130 at this time. 

44. The ping command checks whether the specified network server is in a connectable state.

ping [-c num] ip or hostname

-c Set the number of checks. If not set, it will continue to check an infinite number of times.

For example, ping -c 3 baidu.com

45. The wget command is a non-interactive file downloader that can download network files in the command line.

wget [-b] url

-b means background download (backend), and the log will be written to the wget-log file in the current working directory. Do not add this parameter means direct download.

The url parameter indicates the download link.

46. ​​The curl command can send http network requests, which can be used to download files, obtain information, etc.

curl [-O] url

-O is used to download files, when the url is a download link, the file can be saved.

url indicates the network address from which the request is initiated.

47. The role of the port: the entrance and exit for the computer to interact with the outside world.

Ports are divided into physical ports (also called interfaces, such as USB ports, HDMI ports, etc.) and virtual ports.

The virtual port is locked to a certain program of the computer, used for the interactive use between the operating system and the outside world, and is a bridge connecting the system and the program.

The Linux system internally supports 65535 ports, including:

① Recognized ports: 1-1023, built into the system, such as port 22 for ssh service, port 443 for HTTPS service.

② Registration port: 1024-49151, which can be used freely to bind some programs/services.

③ Dynamic port: 49152-65535, which will not be bound to the program for temporary access.

48. Use the nmap command to view the port occupancy. 

Install this command first:

yum -y install nmap

The IP address being viewed by nmap

You can view the port of the machine through nmap.

49. The netstat command to view the usage of the specified port. 

Install:

yum -y install net-tools

netstat -anp | grep port number

50. Use the ps command to view process information in the Linux system. 

ps [-e -f]

-e displays all processes.

-f Displays all information in formatted form.

Usually, use the ps -ef command.

 51. The kill command closes the process.

 kill [-9] process ID

-9 means to forcibly close the process.

 

 

Guess you like

Origin blog.csdn.net/baidu_41774120/article/details/132128612