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.

How to run VLC player as root user

sed -i 's/geteuid/getppid/' /usr/bin/vlc

Explanation: The initialization script check if the UID is equals to zero. Zero is reserved for the root user. Using sed to replace geteuid for getppid fools the initialization script because it is always > 0.

While running the VLC as root is not recommended, it works. Be aware of the risks and obviously do not do it for production environments.

A Simple Guide to Installing Both Firefox 4 and Firefox 3 on Ubuntu

Step 1: Add the Mozilla Daily PPA Repository#

First, open up your terminal window. Once it’s up, type in the command below to add the Ubuntu Mozilla Daily PPA repository to your system:

sudo add-apt-repository ppa:ubuntu-mozilla-daily/ppa

You’ll be prompted to enter your password. Go ahead and do that, then hit Enter to confirm the addition of the repository.

Step 2: Update Your Package List#

After adding the repository, it’s crucial to update the package list to ensure you get the latest software. Type the following command:

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.