Skip to main content

Monitor and manage the processes

 


Monitor and manage the processes:


df: report the filesystem disk space usage.

df -h output format: filesystem: size: used: available: use %: mounted on

du: estimate the file space usage.

du/: list all the files present in the/with its size.

du-k/ list the files in/and its size in kb

du-k/1sort-ar | more: lists the files inside the / with its size in KB sorts the output with highest size on the top and lists the output one page at a time.

du-h | sort-ar | more: lists the files inside the / with its size in human readable format sorts the output

with highest size on the top and lists the output one page at a time.

 df-hT: lists the filesystem and shows the filesystem type and gives the size in human readable format.

uptime: tells you how long the system is running.

top: display the linux processes.

free: this command gives the information about your memory.

free-m: gives the memory size in megabyte.

Isof: list open files.

tcpdump: It is used to capture, filter, and analyze network traffic such as TCP/IP packets going through your system.

tcpdump -i enpos3: shows the network traffic coming in and out of the interface enpos3.

netstat: "netstat stands for network statistics. It allows users to display network-related information and diagnose various networking issues. 

netstat -a more shows both listening and non listening sockets.

netstat -at: This command specifically lists all TCP ports, giving you information about the TCP connections your system is engaged in.

netstat-au: this command focuses on UDP ports, revealing details about UDP connections.

netstat -1: list only the listening ports.

netstat -It: list only the listening top ports.

netstat-lu: list only the listening udp ports.

netstats: list the statistics for all the ports

netstat-st: displays statistics exclusively for TCP ports.

netstat-su: statistical information related to UDP ports.

netstat-pt: displaying Process ID (PID) and program names associated with network connections.

netstat -r: command retrieves kernel routing information, displaying destination addresses, gateways, and interface details.

netstat -ap | grep ssh To find the port on which a specific program, in this case, SSH, is running, use this command.

netstat -i to obtain a list of network interfaces

 netstat -ie: For extended information on interfaces.


ps-A: list all the running processes in linux

ps-a: View all processes except both session leaders and processes not associated with a terminal.

ps-T: List All Processes Associated with this Terminal in Linux

ps-e: Print all the processes within the system.

ps-e-f: list of all the processes running on your Linux systent in a more detailed format

ps-C systemd list of all the processes running on your Linux system that are related to the systemd process management system.

ps-u root: display information about all processes on the system that are owned by the root user.

ps -ef | more  : list all the processes in the linux system and shows the output one page at a time .

kill psid : kills the process whose process id is psid.

kill -9 psid : kills the process harshly whose process id is psid.


Comments

Popular posts from this blog

Linux basic commands

 Linux basic commands: du  -sh  *  |  sort  -h  -r   |  head  -n  40  :    list out first 40 files in the directory that are taking more space in the directory.  cd : change directory Is-l listing the items in long listing format  pwd : print working directory Is-I format: type :no of links:owner : group:size :month :day :time :name cd/: go to/directory whoami: tells us by which username we are logged in. touch jerry: creates the file named jerry in present working directory. cp jerry lex: copy the content of jerry file and paste it to lex file. vi text1: creates the file text1 and open it in vi editor mkdir superman: creates the directory called superman mkdir abc def  : creates 2 folder in one command. touch filename wont work in /etc/ folder if logged in by normal account. man cp: shows manual for cp command. echo "india is my country"> file1 puts the text in file1. rm filename: remove the filename  mv lex luther renames the file from lex to luther  mv luther /h

patching tasks

 Patching a Linux system is a critical task to ensure that the system remains secure, stable, and up-to-date with the latest features and fixes. Here’s a comprehensive guide to the tasks involved in Linux patching: 1. Pre-Patching Preparation Backup System : Ensure you have a full system backup, including critical data, configuration files, and applications. Test the backup to verify its integrity. Check Disk Space : Verify that you have enough disk space, particularly on /var , /tmp , and /boot partitions. Review Current Patch Level : Determine the current patch level and installed packages using package management tools like yum , apt , dpkg , or rpm . Check System Logs : Review system logs to identify any issues that might affect the patching process. Test in a Staging Environment : If possible, apply patches in a staging environment that mirrors production to identify potential issues. Notify Stakeholders : Inform stakeholders about the scheduled maintenance window and expected do