Skip to Content
gnux

-w, --number-width

Use NUMBER columns for line numbers (default 6).

An option of nlx.

Usage

nlx -w NUMBER [FILE]...
nlx --number-width=NUMBER [FILE]...

Details

ShortLongValueDefaultMeaning
-w--number-widthNUMBERuse NUMBER columns for line numbers (default 6)

Examples

Turn a list of steps into a numbered checklist

nlx -w 2 -s '. ' steps.txt
Output
 1. Back up the database
 2. Stop the service
 3. Run the migration

Give records fixed-width, zero-padded IDs

nlx -n rz -w 5 -s , names.txt > names.csv
Output
00001,Ada
00002,Grace
00003,Linus

Number lines left-aligned with no padding before the text

nlx -n ln -w 1 -s ' ' todo.txt

Number lines in the portable gnux shell

gnux shell -c 'sortx names.txt | uniqx | nlx -w 3'

Help in the terminal

gnux help nlx --number-width

On this page