Bit Shifts

Learn what bit shifts are and how we can use them in Bash.

What are bit shifts?

A bit shift changes the positions of the bits in a number.

There are three types of bit shifts:

  1. Logical
  2. Arithmetic
  3. Circular

The simplest shift type is the logical one. Let’s consider it first.

Any bit shift operation takes two operands. The first one is some integer ...

Access this course and 1400+ top-rated courses and projects.