Useful format specifiers for printf in Bash

Hey, I'm a postgraduate in Cyber Security with practical experience in Software Engineering and DevOps Operations. The top player on TryHackMe platform, multilingual speaker (Kazakh, Russian, English, Spanish, and Turkish), curios person, bookworm, geek, sports lover, and just a good guy to speak with!
The bash printf command is a tool used for creating formatted output. Here are some examples of some of the most useful printf format specifiers:
%s- used to print a string. For example:name="John" printf "Hello, %s!\n" $nameOutput: Hello, John!
%d- used to print an integer. For example:x=5 printf "%d\n" $xOutput: 5
%f- used to print a floating-point number. For example:x=3.14159 printf "%.2f\n" $xOutput: 3.14
%x- used to print an integer in hexadecimal format. For example:x=255 printf "%x\n" $xOutput: ff
%o- used to print an integer in octal format. For example:x=255 printf "%o\n" $xOutput: 377
%c- used to print a single character. For example:x='A' printf "%c\n" $xOutput: A
%b- used to print an integer in binary format. For example:x=5 printf "%b\n" $xOutput: 101
%e- used to print a floating-point number in scientific notation. For example:x=3.14159 printf "%e\n" $xOutput: 3.141590e+00





