Linux Find Out What Process Are Using Swap Space

To find out which processes are using swap space in Linux, you can use the “top” or “pmap” command. “top” command: The “top” command provides an interactive display of system information, including a list of processes and their associated resource usage. You can use the “top” command to see the amount of swap space being … Read more

How to run shell script in Linux

A shell script is a text file that contains shell commands, and can be executed on a Linux system. Here are the steps to run a shell script in Linux: Make the script executable: chmod +x script.sh Replace “script.sh” with the actual name of your shell script file. This step sets the execute permission on … Read more

Vi / Vim Quit Without Saving Command

To quit the Vim editor without saving changes, you can use the following command while in normal mode: :q! The “!” forces the quit without saving any changes. If you have made changes to a file in Vim and you want to exit without saving those changes, simply type the above command and press “Enter”. … Read more

Linux / Unix: pwdx Command Examples

The “pwdx” command in Linux/Unix is used to display the current working directory of a process. Here are some examples of using the “pwdx” command: Display the current working directory of a specific process: pwdx process-id Replace “process-id” with the actual process ID that you want to check. Display the current working directories of multiple … Read more

Ubuntu / Debian: Restart Named Service Command

To restart a named service on Ubuntu or Debian, you can use the following command: sudo systemctl restart service-name.service Replace “service-name” with the actual name of the service you want to restart. For example, to restart the Apache web server, you would run: sudo systemctl restart apache2.service You need to have root privileges (using “sudo”) … Read more

Linux / Unix: users Command Examples

The “users” command in Linux/Unix is used to list the names of the users who are currently logged into the system. Here are some examples of using the “users” command: List all logged in users: users Display names of users in a specific format: users | tr ‘ ‘ ‘\n’ This will display each username … Read more