Open In App

colrm command in Linux with examples

colrm command in Linux is used for editing text in source code files, script files or regular text files. This command removes selected columns from a file. A column is defined as a single character in a line.

Syntax:



colrm [start] [stop]

Example 1: Here, we take input from stdin. Here the start and end are different. So all the characters between start and end, including start and end will be removed. Same can be used on a file (See example 2)



In the example given below, we take input form stdin. Here the start and end column are same i.e 6. So only the sixth character will be removed.

Example 2: Here, we first make a text file using cat command and then use colrm on the file.

Article Tags :