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: Access the Server: First, log in to your Proxmox server via SSH. ...

2023年10月17日 · 2 分钟 · 226 字 · Me

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

Using pdftotext: 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. 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. ...

2023年9月5日 · 3 分钟 · 528 字 · Me

Replace all dots in filenames except the extension on Linux

for f in .; do pre="${f%.}"; suf="${f##.}"; mv -i -f -- "$f" "${pre//./_}.${suf}"; done

2021年1月21日 · Shafiq Alibhai

Count number of directories in the current directory using Linux cli

ls -1 | wc -l

2020年7月14日 · 1 分钟 · 5 字 · Shafiq Alibhai

Count number of files in a directory using Linux cli

ls -l . | egrep -c '^-'

2020年7月14日 · Shafiq Alibhai

One liner: To get available virtual memory

vmstat -s -SM | grep "free memory" | awk -F" " '{print$1}'

2011年12月10日 · Shafiq Alibhai

Perl – system load

To find the system load use the following perl snippet : 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'); 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'); 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');

2010年9月7日 · Shafiq Alibhai

Preserve File Permissions While Copying Files in Linux

Following is the command : cp -p /aaa/bbb /ccc/ddd

2010年6月14日 · Shafiq Alibhai

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: ...

2010年3月23日 · Shafiq Alibhai