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!