In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
What are the operation and maintenance commands in linux? Many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can gain something.
I. system monitoring
1. Free command
The free command displays the physical free and used memory in the system, as well as swapped memory, as well as the buffers and caches used by the kernel
Syntax: free [param]
Param can be:
-b: displays memory usage in Byte
-k: displays memory usage in KB
-m: displays memory usage in MB
-o: do not show buffer adjustment column
-s: continuously observe memory usage
-t: displays the memory sum column
-V: displays version information.
Mem: represents physical memory statistics
Total: represents the total physical memory (total=used+free)
Used: indicates the amount that the system allocates to cache usage (the cache here includes buffer and cache)
Free: represents the total number of unallocated physical memory
Shared: indicates shared memory
Buffers: the number of buffers allocated by the system but not used.
Cached: the number of cache allocated by the system but not used.
-/ + buffers/cache: indicates the cache statistics of physical memory
(- buffers/cache) memory: (refers to the used-buffers-cached in the first part of the Mem line)
(+ buffers/cache) memory: (refers to free + buffers + cached in the first part of the Mem line)
(- buffers/cache) indicates the number of memory actually used, and (+ buffers/cache) indicates the number of memory that is really unused
Swap: indicates the use of swapped partitions on the hard disk
2. Ulimit command
Ulimit is used to display information about system resource limits
Syntax: ulimit [param]
The param parameter can be:
-a displays the current resource limit settings.
-c sets the maximum value of the core file in blocks.
-d the maximum value of the program data section in KB.
-f shell can create the largest file, in chunks.
-H sets hard limits on resources, that is, those set by administrators.
-m specifies the upper limit of available memory in KB.
-n specifies the maximum number of files that can be opened at a time.
-p specifies the size of the pipe buffer in 512 bytes.
-s specifies the upper limit of the stack in KB.
-S sets flexible limits for resources.
-t specifies the upper limit of CPU usage time (in seconds).
-u the maximum number of programs that users can open.
-v specifies the upper limit of virtual memory available in KB
3. Top command
The top command can view the overall operation of the system in real time and dynamically. It is a practical tool that integrates multi-party information to monitor the performance and operation information of the system.
Syntax: top [param]
The param is:
-b: operate in batch mode
-c: displays the complete governance command
-d: screen refresh interval
-I: ignore the failure process
-s: secret mode
-S: cumulative mode
-u [user name]: specify a user name
-p [process number]: specify the process
-n [times]: the number of times the loop is displayed.
4. Df command
Df-h to view disk usage
Df-I view inode usage
5. Ps command
The ps command is used to view process statistics
Common parameters:
A: displays all the process information under the current terminal, including the processes of other users.
U: use a user-based format to output process information.
X: displays the progress of the current user under all terminals.
-e: displays all process information in the system.
-l: displays process information in long format.
-f: displays process information in full (full) format.
You can use it with the grep command, or you can use it alone
# when the ps command is used alone, ps-elf tomcat# combines pipe operation and grep command to filter to query the information of a process ps-elf | grep tomcat II. 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:
-f: circular read
-Q: no processing information is displayed
-v: displays detailed processing information
-c [number]: number of bytes displayed
-n [lines]: displays the contents of the last n lines of the file
-pid=PID: used with-f to indicate that it ends after the process ID,PID dies
-Q,-- quiet,-- silent: never output the first part of the given file name
-s,-- sleep-interval=S: used with-f to indicate dormancy for S seconds at intervals of each iteration
2. Ll-ah
Ll-ah command, which can be used to view files
Ll-ah III. Network communication
1 、 netstat
The netstat command is a command-line tool for monitoring statistics of packets and network interfaces entering and leaving the network.
Syntax: netstat [param]
The param parameter can be:
-h: view help
-r: displays the routing table
-I: view network interfaces
2. Restart the network
If the linux network is set up, you need to restart the network. You can use the command:
Service network restart
3 、 SELinux
SELinux, whose full name is Security-Enhanced Linux, is contributed by the National Security Agency (NSA). It introduces a robust mandatory access control Mandatory Access Control architecture for Linux kernel systems. For more information, please see getting started with SELinux and how SELINUX works.
In fact, the function of SELinux is similar to that of firewall, but the security is relatively good, ok, so this blog introduces the commands of SELinux.
View selinux status
Getenforce
Temporarily disable SELINUX (only linux for learning can be disabled, SELINUX is not recommended for production)
Setenforce
Permanently disable SELINUX (only linux for learning can be disabled, SELINUX is not recommended for production)
# change SELINUX=enforce to SELINUX=disabled vi / etc/selinux/config
4. Firewall
Query the open status of linux system firewall
Firewall-cmd-state
Temporarily turn off the firewall (only linux for learning can be disabled, SELINUX is not recommended for production)
Systemctl stop firewalld.service
Permanently turn off the firewall (only linux for learning can be disabled, SELINUX is not recommended for production)
Systemctl disable firewalld.service IV. System management
1 、 uname
The uname command is used to view the kernel version
2 、 ip addr
Check the ip address of linux: you can use the command
Ip addr what is Linux system Linux is a free to use and freely spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.