Day 12 Learnings: Network and Connectivity in Linux
Today, I delved into network and connectivity topics in Linux, focusing on monitoring system activity and managing processes effectively. These tools are essential for optimizing system performance and ensuring seamless operation.
What I Learned This Week
Monitoring System Activity with the
top
Command:
Thetop
command provides real-time insights into system performance, including CPU usage, memory consumption, and active processes.Terminating Processes with the
kill
Command:
Thekill
command allows you to terminate misbehaving or unnecessary processes by sending specific signals.
Steps I Followed
System Monitoring | top
Command
Launch
top
:
Opened the command in the terminal:top
The display included process details such as PID, user, CPU usage, and memory usage.
Navigate the Interface:
Used
k
to kill a process directly.Pressed
q
to exit thetop
interface.
Filter by User:
Displayed processes for a specific user:top -u username
Customize Display:
Sorted processes by memory usage:top -o %MEM
Managing Processes | kill
Command
Find Process ID (PID):
Used theps
ortop
command to identify the PID of the process to terminate:ps -e | grep process_name
Terminate a Process:
Sent the defaultSIGTERM
signal to a process:kill PID
Force Kill a Process:
Used theSIGKILL
signal to terminate stubborn processes:kill -9 PID
Kill Multiple Processes:
Sent a termination signal to multiple PIDs:kill PID1 PID2
Problems I Encountered
Unresponsive
top
Navigation:
Initially struggled to navigate thetop
interface effectively.Permission Denied Errors with
kill
:
Encountered permission errors while trying to terminate processes started by another user.
How I Solved These Problems
Exploring
top
Documentation:
Usedman top
and keyboard shortcuts withintop
to navigate and customize the interface.Using
sudo
for Elevated Permissions:
Resolved permission errors by running thekill
command withsudo
:sudo kill PID
Resources I Used
Linuxize Guide to top Command
Linuxize Guide to kill Command
Community forums for troubleshooting tips and practical examples.
Conclusion
Today’s learnings introduced me to powerful tools for monitoring and managing system performance. The top
command helps keep tabs on system activity, while the kill
command provides precise control over processes.
Looking forward to Day 13 and exploring more Linux functionalities!