PS | TOP | Kill

Ãœ  PS AUX [Display information all running processes]
 
·        ps - Process Status command, which display information about all running processes.
·        a: Shows all processes, including those from other users. Without this, ps might only show processes from your current session.
·        u: Displays the process list in a user-oriented format. It shows the username of the process owner, CPU usage, memory usage, and other details in a more readable format.
·        x: Includes processes that don't have a controlling terminal (i.e., background processes).

 
Explanation of Output Columns:

·        USER: The username of the process owner.
·        PID: Process ID.
·        %CPU: The percentage of CPU time the process is using.
·        %MEM: The percentage of physical memory (RAM) the process is using.
·        VSZ: Virtual memory size (in kilobytes).
·        RSS: Resident Set Size – the non-swapped physical memory used by the process (in kilobytes).
·        TTY: The terminal associated with the process, or "?" if none.
·        STAT: Process status (e.g., S for sleeping, R for running).
·        START: The time the process started.
·        TIME: Total CPU time consumed by the process.
·        COMMAND: The command that started the process.

Ãœ  ps -ef | grep apache [Command is commonly used search for specific processes running on the system]
 
·        ps: This command displays information about the running processes.
·        -e: Shows information for all processes on the system (not just processes of the current user).
·        -f: Provides a full-format listing, which includes more detailed information about each process such as the UID, PID, PPID, and the full command that started the process.
·        grep: grep is used to filter the output of ps -ef to display only the lines that match a certain pattern or keyword.
 
[root@sysadmin ~]# ps -ef | grep apache
 

Explanation of Output Columns:
 
·        UID: The user ID that owns the process.
·        PID: Process ID.
·        PPID: Parent Process ID (the ID of the process that started this process).
·        C: CPU utilization of the process.
·        STIME: Start time of the process.
·        TTY: Terminal associated with the process (or "?" if none).
·        TIME: Total CPU time used by the process.
·        CMD: Command that started the process.

Ãœ  Kill a Process

·        Kill the process using its PID[Graceful Termination]
    o   kill PID - kill 1234
·        Kill a Process using forcibly terminates[Forced kill]
    o   kill -9 PID - kill -9 1234

Ãœ  TOP [utility that provides real-time, dynamic monitoring of system processes]


·  Current Time: 11:23:45
·  System Uptime: up 2:53 (the system has been running for 2 hours and 53 minutes).
·  Users: 3 users (the number of users logged in).
·  Load Average: 0.45, 0.30, 0.25 (the system load averages for the last 1, 5, and 15 minutes, respectively). A lower value means less load.
·  Tasks:
    o   235 total: Total number of tasks (processes).
    o   1 running: Number of tasks actively running on the CPU.
    o   234 sleeping: Processes waiting for an event (such as input/output).
    o   0 stopped: Processes that have been stopped.
    o   0 zombie: Defunct processes that have completed execution but still exist in the process table.
 
·        %Cpu(s): CPU usage details:
    o   us (user): Time spent on user processes (non-kernel).
    o   sy (system): Time spent on system processes (kernel).
    o   ni (nice): Time spent on processes with a manually set priority.
    o   id (idle): Time the CPU was idle.
    o   wa (I/O wait): Time spent waiting for I/O operations.
    o   hi (hardware interrupts): Time handling hardware interrupts.
    o   si (software interrupts): Time handling software interrupts.
    o   st (steal time): Time stolen from the VM by hypervisor.
 
·        Memory (MiB Mem): Current memory usage:
    o   total: Total amount of physical RAM.
    o   free: Free (unallocated) memory.
    o   used: Memory actively in use by processes.
    o   buff/cache: Memory used by the kernel buffers and cache.
 
·        Swap (MiB Swap): Information on swap space:
    o   total: Total amount of swap space.
    o   free: Unused swap space.
    o   used: Used swap space.
    o   avail Mem: Available memory including swap.


      ·        PID: Process ID.
·        USER: The user who owns the process.
·        PR: Process priority (lower number = higher priority).
·        NI: Nice value (priority adjustment for the process).
·        VIRT: Virtual memory size used by the process.
·        RES: Resident memory (physical memory) used by the process.
·        SHR: Shared memory used by the process.
·        S: Process status:
    o   R: Running.
    o   S: Sleeping.
    o   D: Uninterruptible sleep (usually I/O).
    o   Z: Zombie.
    o   T: Stopped.
·        %CPU: CPU usage percentage by the process.
·        %MEM: Memory usage percentage by the process.
·        TIME+: Total CPU time the process has used since it started.
·        COMMAND: The name of the command or process.

Ãœ  Interactive Commands (While top is running):
 
·        k: Kill a process by specifying its PID.
·        r: Renice a process (change its priority).
·        q: Quit top.
·        Shift + P: Sort processes by CPU usage (default).
·        Shift + M: Sort processes by memory usage.
·        Shift + T: Sort processes by the amount of CPU time they have used.
·        u: Filter processes by a specific user.
·        h: Show the help screen.
 

Previous Post Next Post

نموذج الاتصال