Latest web development tutorials

Linux colrm command

Linux command Daquan Linux command Daquan

Linux colrm command is used to filter out the specified line.

colrm instruction read from the standard input device secretary, turned to the standard output device. If you do not add any parameter, the command does not filter any line.

grammar

colrm [开始行数编号<结束行数编号>]</p>

<p><b>参数说明:</b></p>
<ul>
<li>开始行数编号: 指定要删除的列的起始编号。</li>
<li>结束行数编号: 指定要删除的列的结束编号,有时候这个参数可以省略。</li>
</ul>
<h3>实例</h3>
<p>不带任何参数时该命令不会删除任何列:</p>
<pre>
colrm

Press the Enter key, the cursor will blink on the first line, waiting for the standard input and the input characters, such as "Hello Linux!", The second line will appear in the first row of the same content after press the Enter key, then press ctrl + C key combination to exit. The terminal displays the content as follows:

cmd@hdd-desktop:~$ colrm  
Hello Linux! #输入Hello Linux!字符串  
Hello Linux! #输出刚才输入的字符串Hello Linux! 

As you want to delete all the content after the first four, you can use the following command:

colrm 4

Similar to the previous example, this time waiting for input standard input, the user input string press Enter, it will output the following results:

cmd@hdd-desktop:~$ colrm 4  
Hello Linux! #输入Hello Linux!字符串  
Hel #输出删除了第4列以后所有内容的字符串 

Delete contents of the specified column. Such as deleting Clause 4 to Article 6, use the following command:

colrm 4 6 

Output results are as follows:

cmd@hdd-desktop:~$ colrm 4 6  
Hello Linux! #输入Hello Linux!字符串  
HelLinux! #输出删除了从第4列到第6列字符的字符串 

Linux command Daquan Linux command Daquan