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

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.

2020年5月18日 · Shafiq Alibhai

One liner: To get available virtual memory

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

2011年12月10日 · Shafiq Alibhai

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

2011年2月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