DEV Community

shun
shun

Posted on

System Operations in Linux

Performing system operations is a crucial part of managing a Linux system. Here are some essential commands for handling

System Operations in Linux

ps: Display currently active processes

  • Basic usage:
  $ ps
Enter fullscreen mode Exit fullscreen mode
  • Show all processes for all users:
  $ ps aux
Enter fullscreen mode Exit fullscreen mode

top: Real-time Process Monitoring

  • Basic usage:
  $ top
Enter fullscreen mode Exit fullscreen mode
  • Some key commands while top is running:
    • q: Quit top
    • u: Show processes for a specific user
    • k: Kill a specific process

kill: Terminate Processes

  • Basic usage (using process ID):
  $ kill [process_id]
Enter fullscreen mode Exit fullscreen mode
  • Send a specific signal to a process (e.g., sending the SIGKILL signal):
  $ kill -[signal] [process_id]
Enter fullscreen mode Exit fullscreen mode

For example, to send the SIGKILL signal:

```bash
$ kill -9 [process_id]
```
Enter fullscreen mode Exit fullscreen mode

shutdown: Shutdown or restart the system

  • Shutdown immediately:
  $ shutdown -h now
Enter fullscreen mode Exit fullscreen mode
  • Reboot immediately:
  $ shutdown -r now
Enter fullscreen mode Exit fullscreen mode
  • Shutdown with a message:
  $ shutdown -h +10 "System will shutdown in 10 minutes"
Enter fullscreen mode Exit fullscreen mode

This will shut down the system in 10 minutes and broadcast the provided message to all logged-in users.

Understanding these system operation commands is essential for effectively managing and maintaining a Linux system.

Top comments (0)