Hello everyone, are you ready to slowly approach the exciting scenes in AI movies that many of us crave? Joke aside, when I wrote my codes in the first terminal and performed the query, in my first hello world correspondence, I was as excited as if it were connected to all the systems in the world. Besides, my excitement grew when I started performing operations on users in the terminal. So I’m ready to do little things that will excite you. If you’re ready, let’s get started.
Step-By-Step Management Commands
- top : A command line that displays all running processes in seconds.
For example, when we run the top command on the console, we need to encounter information such as the visual below. Let’s check it out 🚀
A total of 308 processes are processed, and if you need to examine the table below, the PID ( processing id) contains a unique value. Each process must have its own PID value.
top -o PID
In the code line above, a sort is performed according to PID values.
top | grep firefox
If this code is wrapped, the top command instantly fetches the last line of firefox. It should be noted that the top command works instantaneously in the terminal.
By the way, % CPU determines the amount of use of the central processing unit by processes while %MEM specifies the amount of memory usage.
Just press the ‘q’ character to re-process the terminal.
- ps : Lists all process information currently running on your computer.
If we want to know the PID value of the running process, we need to write the following line of code.
ps aux | grep safari
NOTE: The ps aux command only gives all process information when used.
This browser information could have been firefox, you can write it if you want to know which process. So why do you think it’s important to learn PID values? Let me think about it. How do you recognize an unidentified person? Processes must have an identity just like people. When killing processes, processing should be performed according to ID values, not according to processing names.
- kill : Kills processes with Kill signals.
❗️To list the kill signals, we must necessarily use the -l argument.
kill -7 2574
For example, we want to kill the signal sent by the firefox process, but we should definitely do this by specifying the PID. In the above command, we send a request to kill signal 2754.
If we summarize, the process commands that we use most often are like this. In my next article, I will talk about user management commands. I wish you healthy and abundant research days. Hope to see you.
Yasin Ortakci, Karabuk University, Operating Systems Lab.