1. Command Introduction nl (Number of Lines) adds line numbers to the specified file and writes it to standard output. If no file is specified or the specified file is "-", the program will read data from standard input. 2. Usage nl [options]... [file]... 3. Options : : : : : : : : : : : : : : : CC is the two delimiters used to separate logical page numbers. The missing second character implies ":". If you specify "\", Please enter "\\". The available styles are: a Number all lines t Number non-blank lines n Do not number lines pBRE Number only lines that match the regular expression BRE FORMAT is one of the following: ln Left-aligned, no spaces are filled with 0rn Right-aligned, no spaces are filled with 0rz Right-aligned, spaces are filled with 0 4. Examples Example 1: Display line numbers [root@oracledb study]# nl test1.log 1 2011 2 2012 3 2013 Example 2: Display line numbers and specify alignment [root@oracledb study]# nl -nln test1.log 1 2011 2 2012 3 2013 [root@oracledb study]# nl -nrn test1.log 1 2011 2 2012 3 2013 [root@oracledb study]# nl -nrz test1.log 000001 2011 000002 2012 000003 2013 Example 3: Specify a width of 4 bits and the default is 6 bits [root@oracledb study]# nl -nrz -w 4 test1.log 0001 2011 0002 2012 0003 2013 Example 4: Number the contents of standard input [root@oracledb study]# nl line1 1 line1 line2 2 line2 line3 3 line3 [root@oracledb study]# Press ctrl+D to end the input. or EOF(End Of File) [root@oracledb study]# nl <<EOF > line1 > line2 > line3 > EOF 1 line1 2 line2 3 line3 The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Two methods of MySql comma concatenation string query
>>: MySQL 8.0.17 decompression version installation and configuration method graphic tutorial
Official Website https://cli.vuejs.org/en/guide/ ...
The <tfoot> tag is used to define the style...
Table of contents 1. Node.js and Vue 2. Run the f...
Preface When developing static pages, such as Vue...
1. Simple configuration of nginx's dynamic an...
RedHat6.5 installation MySQL5.7 tutorial sharing,...
Table of contents 1. The concept of process and t...
MySQL itself was developed based on the file syst...
A: Usually stored in the client. jwt, or JSON Web...
MySQL server has gone away issue in PHP 1. Backgr...
Table of contents 1. Implementation 2. Problems 3...
Preface Today, a developer gave me feedback that ...
This tutorial shares the installation tutorial of...
Table of contents origin status quo Cancel reques...
today select * from table name where to_days(time...