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.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay