From the Linux endpoint management process: 10 commands you must know

Source: Internet
Author: User
Tags pkill

from the Linux endpoint management process: 10 commands You must know the Linux terminal has a series of useful commands. They can show the running process, kill the process, and change the priority of the process. This article lists some of the classic traditional commands and some useful new commands. The commands mentioned in this article implement a single function. Other commands, such as Htop, provide a friendly interface on the upper level of the command for use by the user. The Toptop command is a common command for viewing system resource usage and viewing processes that occupy the most system resources. Top displays all the processes in columns, and the process that accounts for the most CPU resources is displayed at the top. To exit top or htop, you can use the keyboard shortcut CTRL-C. This keyboard shortcut usually terminates the process currently running on the terminal. The Htophtop command is the improved version of top. By default, most Linux distributions are not installed htop--installed on Ubuntu system can run the following command: sudo apt-Getthe Install htop htop command displays the same information as top, but its interface is more user-friendly. You can use the keyboard arrow keys to select processes and take certain actions, such as killing processes or changing their priority. We have explained Htop in detail in the past. The PSPs command can list running processes. The following command lists all the commands that run on your system: PS-A This command lists information that may be too much and inconvenient to read. You can use the less command to pipe the output so that you can scroll at your speed to read: PS-A |Less When you are finished reading, you can press Q to exit. You can also use grep to pipe the output so that you can search for a process without having to use other commands. The following command searches the Firefox process: PS-A |The grep firefox pstreepstree command can also display process information. It shows the process in the form of a tree. For example, your X system and graphics environment will appear below the display manager that produces the tree process. The Killkill command can kill a process based on the process ID. You can use PS-A,top, or the grep command gets to the process ID. Kill PID Technically speaking, the KILL command can send any signal to a process. You can use the kill-kill or Kill-9来 kills the stubborn process. Pgrep given a search keyword, the pgrep command returns all process IDs that match that keyword. For example, you can use the following command to find Firefox pid:pgrep Firefox You can also combine this command with the KILL command to kill a particular process. However, it is easier to use Pkill or killall. Pkill&the Killallpkill and Killall commands can kill a process based on the name of the process. Use any of the following methods to kill the Firefox process: Pkill firefox killall firefox renicerenice command to change the nice value of the process. The nice value represents the priority of the process. -the nice value of 19 is a very high priority, whereas 19 is a very low priority. 0 is the default priority. The ID of the process is required to run the Renice command.    The following command allows a process to run at a very low priority level. Renice +pid You can combine Pregrep and renice to use as shown. If you want to increase the priority of the process, you need to use root privileges. In Ubuntu system, use sudo to get root privileges: sudo renice- +# xkillxkill command is a command that can easily kill the graphics level. After you run it, your cursor will turn into an X symbol. Click on the corresponding Graphics program window to kill the program. If you want to give up the operation halfway, you can click the right mouse button to cancel. You don't have to run this command at the terminal-you can press ALT on the graphical desktop-F2, enter Xkill and press ENTER to run it. We've bound Xkill and hotkeys so it's easier to kill the process. Do you have any favorite commands we don't mention here, or are there any other tips you can share? Please leave your comment. 

From the Linux endpoint management process: 10 commands you must know

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.