fbpx
Increment a variable in Bash

Increment a variable in Bash

Suppose you have a variable below how would you increment that variable by 1 in Bash x=0 You can use let x++ If we want to loop through a number of items while incrementing the x variable, we can use the for loop below: for name in Lisa Lilly Lousa ; do echo $x $name...
Convert images to PDF using Python

Convert images to PDF using Python

In a previous blog post, we mass cropped images using a for loop in Bash. After cropping all of those images, I faced another challenge which is to have an easy way to view all the cropped images in one file instead of trying to go through 200 different files. The...
Mass Crop Images with Bash

Mass Crop Images with Bash

Most Linux distributions and also Mac OS has ImageMagick installed. If however, it is not installed, you can follow the instructions at https://imagemagick.org/script/download.php ( including Windows ) To crop an image, you can simply use the command below: convert...
How to Customize Your Bash Prompt

How to Customize Your Bash Prompt

Most Bash prompts are configured in the format user@host <working directory>$ but did you know you can customize it? The value of the Bash prompt is contained in the environmental variable $PS1. For instance, on a CentOS server I’m working on $PS1 is...