KandZ – Tuts

We like to help…!

Linux CLI 48 ๐Ÿง nl, fold and fmt commands

a - nl command
nl command is used to number lines of text lines
It is useful when referencing or citing specific lines in a document
common options: -b a โ†’ number all lines, default -b t โ†’ number non blank lines, -n ln|rz|rn โ†’ sets specified format -i # โ†’overrides default incremetn
nl filename.txt โ†’numbers lines
nl -n rz filename.txt โ†’ numbers lines and sets right alignment and fills with zeros
nl -n ln filename.txt โ†’ numbers lines and sets left alignment
nl -n rn filename.txt โ†’numbers lines and sets right alignment
nl -i 2 filename.txt โ†’ numbers lines but increments by 2

b - fold command
fold command wraps input text into a specified width
It is useful for formatting long lines of text into readable paragraphs
common commands: -w# โ†’ specifies the length(n) of the line
-s โ†’ breaks lines on spaces
fold longtext.txt โ†’ wraps the text on default length
fold -w20 longtext.txt โ†’ specifies the line length to 20
fold -s longtext.txt โ†’ breaks the lines on space

c - fmt command
fmt command formats text paragraphs
It automatically adjusts the length of lines to fit within width margins
Default length is 75 characters
common options: -w โ†’ specifies the line length
-c โ†’ paragraphs have consistent line length by breaking them at a natural stopping point
fmt format.txt โ†’ formats the text at 75 characters long
fmt -w20 format.txt โ†’ specifies the line length to 20
fmt -w20 -c format.txt โ†’ specifies the length and breaks them at a natural stopping point

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