This blog records the Linux operation and maintenance commands needed for work. I started to use Linux in college and knew some basic operations, but I didn't organize them. In addition, I was doing development, not operation and maintenance, so I forgot some commands. So now I organize them into a blog. Of course, I won't introduce vi and file operations. I will slowly accumulate some other extended commands. The blog will be updated from time to time. 1. System monitoring 1. free command The free command can display the physical free and used memory in the system, as well as the swap memory, and also the buffers and caches used by the kernel.
param can be:
Mem: indicates physical memory statistics
-/+ buffers/cache: indicates the cache statistics of physical memory
(-buffers/cache) indicates the amount of memory actually used, and (+buffers/cache) indicates the amount of memory actually not used. Swap: Indicates the usage of the swap partition on the hard disk 2. ulimit command ulimit is used to display information about system resource limits
The param parameter can be:
3. top command The top command can dynamically view the overall operation of the system in real time. It is a practical tool that integrates multiple information to monitor system performance and operation information.
param is:
4. df command
5. ps command The ps command is used to view process statistics Common parameters:
You can use it with the grep command or use it alone. # When the ps command is used alone ps -elf tomcat #Combining pipeline operation and grep command to filter and query the information of a certain process ps -elf | grep tomcat 2. File Operation 1. tail command The tail command can be used to view the contents of a file. The syntax is tail [param] [filename] Where param can be:
2.ll-ah ll -ah command can be used to view file status ll-ah 3. Network Communication 1. netstat The netstat command is a command-line tool used to monitor packets entering and leaving the network and network interface statistics.
The param parameter can be:
2. Restart the network After setting up the Linux network, you need to restart the network. You can use the command: service network restart 3. SELinux SELinux stands for Security-Enhanced Linux, which was contributed by the National Security Agency (NSA) of the United States. It introduces a robust Mandatory Access Control architecture for the Linux kernel subsystem. For more details, please refer to SELinux Introduction, SELINUX Working Principle In fact, the function of SELinux is similar to that of a firewall, but it is relatively safer. OK, so this blog introduces the usage commands of SELinux. Check selinux status getenforce Temporarily disable SELINUX (only for learning Linux, it is not recommended to disable SELINUX for production) setenforce Permanently disable SELINUX (only for learning Linux can be disabled, it is not recommended to disable SELINUX for production) # Change SELINUX=enforce to SELINUX=disabled vi /etc/selinux/config 4. Firewall Query the Linux system firewall opening status firewall-cmd --state Temporarily disable the firewall (this can only be disabled for learning Linux, it is not recommended to disable SELINUX for production) systemctl stop firewalld.service Permanently disable the firewall (this can only be disabled for learning Linux, and it is not recommended to disable SELINUX for production) systemctl disable firewalld.service 4. System Management 1. uname The uname command is used to view the kernel version 2. ip addr View the ip address of Linux: You can use the command ip addr appendix: Linux Commands (Manual) The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Detailed steps to upgrade mysql8.0.11 to mysql8.0.17 under win2008
>>: Mini Program to Implement the Complete Shopping Cart
This article shares the specific code for JavaScr...
This article shares the installation tutorial of ...
1. Download MySQL database and install and config...
1. Create table statement: CREATE TABLE `employee...
Preparation 1. Check whether the GPU supports CUD...
Table of contents 1. Introduction 2. Actual Cases...
Table of contents style scoped style module State...
Recently I've been working on a framework tha...
Table of contents Problem description: Solution 1...
This article shares the specific code for WeChat ...
React tsx generates a random verification code fo...
For some systems with large amounts of data, the ...
I saw in the LOFTER competition that it was mentio...
Preface: In interviews for various technical posi...
In the previous chapters, we have learned how to ...