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
1. Differences in network configuration between C...
Table of contents forEach() (ES6) method map() (E...
BMP is an image file format that is independent o...
1. Implementation principle of Nginx load balanci...
Table of contents Overall Effect Listen for conta...
1. AIDE AIDE (Advanced Intrusion Detection Enviro...
In Linux systems, especially server systems, it i...
A very useful function group_concat(), the manual...
How to check where the metadata lock is blocked i...
Let me first introduce an interesting property - ...
IP masquerading and port forwarding Firewalld sup...
This article shares the 6 most effective methods,...
If you want to insert 5 records into table1, the ...
Table of contents background 1. The query conditi...
transform: scale(); Scaling will cause jitter in ...