English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux colrm命令

Linux Command大全

Linux colrm command

The Linux colrm command is used to filter out specified lines.

The colrm instruction reads from the standard input device and outputs to the standard output device. If no parameters are added, this instruction will not filter any line.

Syntax

colrm [Start Line Number<End Line Number>]

  • Parameter Description:

  • Start line number: Specify the start number of the column to be deleted.

End line number: Specify the end number of the column to be deleted. Sometimes this parameter can be omitted.

Online Examples

colrm

Without any parameters, this command will not delete any columns:+Press the Enter key, the cursor will blink on the first line, waiting for standard input. At this time, enter a character, such as "Hello Linux!", and press the Enter key again, the second line will appear the same content as the first line, and then press Ctrl

cmd@hdd-desktop:~$ colrm  
Hello Linux! #Input Hello Linux!string  
Hello Linux! #Output the string Hello Linux!just entered

If you want to delete the4 All the content after the column, you can use the following command:

colrm 4

Similar to the previous example, at this time the standard input is waiting for input, and after the user inputs a string and presses the Enter key, the following result will be output:

cmd@hdd-desktop:~$ colrm 4  
Hello Linux! #Input Hello Linux!string  
Hel #Output deleted the4The string after the column

Delete the content of the specified column. For example, delete the4List to the6The content of the column, you can use the following command:

colrm 4 6

The output result is as follows:

cmd@hdd-desktop:~$ colrm 4 6  
Hello Linux! #Input Hello Linux!string  
HelLinux! #Output deleted from the4List to the6String of listed characters

Linux Command大全