MM

Managing Tasks in CentOS 7

The task management tool in CentOS 7 is GNOME System Monitor.

Accessing System Monitor
  • Access it from the desktop:

    • Go to Applications > System Tools > System Monitor.

  • Alternatively, access it via terminal:

    • Command: gnome-system-monitor

System Monitor Tabs
  1. Processes Tab

    • Displays all running processes on the computer, indicating how each process utilizes system resources.

    • Sort information by column by clicking the column name (toggle between ascending and descending).

    • End Process Button: Highlight a process and click this button to stop it safely.

    • Right-click options: Right-click a process to select End or Kill, which allows for more aggressive termination of tasks when necessary.

    • View Menu: Control process display with options such as All Processes, My Processes, Active Processes for better management.

    • Parent processes marked with a diamond symbol next to process names, indicating their hierarchical relationship when the Dependency option is selected.

  2. Resources Tab

    • Shows usage history of CPU, memory, swap memory, and network in graphical format for easy visualization.

    • Command equivalent: free (more details covered later), which provides an overview of memory usage, including total, used, free, and cached memory status.

  3. File Systems Tab

    • Displays information about mounted file systems and their types, helping users understand disk allocations.

    • Shows disk space utilization: total used and free space, aiding in storage management.

    • Columns can be sorted alphabetically or numerically to locate specific drives or partitions easily.

Commands for Task Management
ps command
  • The ps command lists running system processes and their resource usage effectively.

  • Syntax: ps [options]

    • Shows user ownership of processes, which is vital for administration tasks.

    • Displays Process ID (PID) assigned by kernel(the core of and operating system), essential for process management.

Common ps Options:

Option

Description

-e

Selects all processes

-f

Displays a full, detailed listing

-P

Selects specific processes by PID

-T

Selects processes associated with a terminal

-u

Selects processes by user


kill Command
  • The kill command is used to terminate processes, which is crucial for managing unresponsive applications.

  • Basic Syntax: kill [option] PID

    • Sends signals to specified processes with various impacts, allowing for graceful or forced termination.

Common Uses:

  • To stop a specific process:

  kill PID
  • Use -9 for stronger termination:

  kill -9 PID
  • SIGHUP: Cleans up processes effectively; this is cleaner than -9 signal:

  kill -SIGHUP PID
Important Notes
  • Be cautious when using kill with PIDs as it can terminate parent processes and all child processes spawned by it (e.g., killing gnome-session will log the user out).

  • To view processes associated with a user:
    ```bash
    ps -ef | grep User01 | more -d20