Posts Tagged With: number

Add Line Numbers

Tagged with: , , , , , ,

Use this command to add line numbers to a text file…


sed = filename.txt | sed 'N;s/\n/\t/' > filename_number.txt
3 Comments »

Fetch a URL With a Number Series

Tagged with: , , , , , ,

Use this command to download numbered content…


for ((i=1; i<9; i++)) ; do  wget "http://www.example.com/$i.txt" ; done
1 Comment »

Zero Padding In Linux Commands

Tagged with: , , , , , , ,

This is how you zero pad a numerical variable in bash.


for ((x=1;x<=31;x+=1)); do echo `printf "%02d" $x`; done

Original Article

No Comments »