Linux colrm command: Remove columns from a file
Linux colrm command Function Description
Use the colrm command to remove selected columns from the file to send to the standard output.
Linux colrm command Syntax
colrm [Start column [End column]]
Linux colrm command Example
Delete column 3 and the characters after it from the /root/apidemos.com.txt file, and output
colrm 3 < /root/apidemos.com.txt
Output:
Delete the third column of the character abcde and the characters after it, and then output
[root@rhel~]#colrm 3
abcde // Enter the character abcde
ab
// Finally press the [Ctrl+d] key combination to exit
Delete the characters between columns 3 and 5 in the character abcdefghi, and then output
[root@rhel ~]# colrm 3 5
abcdefghi // Enter the characters abcdefghi
abfghi
// Finally press the [Ctrl+d] key combination to exit