Shutdown Proxmox VM using CLI

If you’re looking to shut down a virtual machine running on a Proxmox Virtual Environment (PVE), you can use the Proxmox command-line interface (CLI) to accomplish this task quite effectively. The command for shutting down a VM in Proxmox is qm shutdown, followed by the ID of the virtual machine you’d like to shut down. Here’s how to do it:

  1. Access the Server: First, log in to your Proxmox server via SSH.

How to count number of words in a pdf file from Linux cli

Using pdftotext:#

  1. Installation:

    • If it’s not installed, you’ll need to install the poppler-utils package which includes pdftotext.
    sudo apt install poppler-utils

    or

    yum install poppler-utils

    depending on your distribution.

  2. Usage:

    • Once installed, you can convert a PDF to text and then count the words as follows:
    pdftotext input.pdf - | wc -w

    Here, input.pdf is your source PDF file, and wc -w counts the number of words. The - in pdftotext specifies that the output should be sent to stdout, which is then piped into wc.

Perl – system load


To find the system load use the following perl snippet :

  1. System load of last one minute :
my $system_load = exec('<a class="zem_slink" title="Uptime" rel="wikipedia" href="http://en.wikipedia.org/wiki/Uptime">uptime</a> | awk -F "load average: " \'{ print $2 }\' | cut -d, -f1');
my $system_load = qx('uptime | awk -F "load average: " \'{ print $2 }\' | cut -d, -f1');
  1. System load of last 5 minutes :
my $system_load = exec('uptime | awk -F "load average: " \'{ print $2 }\' | cut -d, -f2');
my $system_load = qx('uptime | awk -F "load average: " \'{ print $2 }\' | cut -d, -f2');
  1. System load of last 15 minutes :
my $system_load = exec('uptime | awk -F "load average: " \'{ print $2 }\' | cut -d, -f3');
my $system_load = qx('uptime | awk -F "load average: " \'{ print $2 }\' | cut -d, -f3');

How to Identify Your Linux Distribution and Version with Simple Commands

If you are using a Linux-based operating system and you want to know which specific distribution and version you have installed, there is a simple command that can help you with that. Just open a terminal window and type the following:

cat /etc/issue

This will display the name and the release number of your Linux distribution. For example, if you are using Debian 4.0, the output will look like this:

Debian GNU/Linux 4.0 \n \l

The \n and \l are special characters that represent the current date and the name of the terminal device, respectively. They are not part of the distribution name.