KandZ – Tuts

We like to help…!

Linux CLI 49 ๐Ÿง pr and printf commands

a - pr command
pr command is used to paginate or columnate file/files
common options: -m โ†’ prints files side by side
-l #number โ†’ page length in lines
-#number โ†’ specifies the number of columns
-h header โ†’ specifies the header as the header of the output
pr -m -l 10 file1.txt file2.txt โ†’ prints the files side by sile, 10 lines length
pr -3 -l 10 file1.txt โ†’ prints the file in 3 columns and 10 lines length

b - printf command
printf command is used to format and print data on the screen.
It can be used to display strings, integers, sfloating-point number and characters
common specifiers: %s โ†’ prints a string
%d โ†’ prints a decimal number %f โ†’ prints a floating-point number
%x โ†’ prints a hexadecimal number %o โ†’ prints an octal number
%c โ†’ prints a single character %e โ†’ prints a scientific notation
printf "My favorite number is %d and my favorite letter is %c.\n" 42 'A'โ†’ replaces %d with 42 and %c with A
printf "Pi is approximately %.2f\n" 3.14159โ†’ replaces the specifier with 3.14, it has two decimals
printf "%b\n" "Hello, World! \n" "How are you doing\n"โ†’ prints the text and handles \n as new line

Stop using slow, ad-bloated tool sites! ๐Ÿคฎ

๐Ÿ”Ž Search “KandZ Tools” on Google to use many professional utilities for free.

KandZ.me is the ultimate minimalist hub for:
โœ… Finance (Mortgage, Interest, Inflation)
โœ… Tech (Base64, JSON, Dev Suite, IP)
โœ… Health (BMI, BMR, TDEE)
โœ… Productivity (Timer, Workspace, QR)

โšก๏ธ Fast & Private
๐Ÿ”’ No data leaves your device
๐Ÿ’Ž 100% Free

๐Ÿ”— Use it now: https://tools.kandz.me
๐Ÿ”– Bookmark itโ€”youโ€™ll need it later!

Leave a Reply

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Powered By
100% Free SEO Tools - Tool Kits PRO