• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

colrm : command not found

by Deepika

The colrm command is a utility in Linux that is used to remove specific columns from a text file. The colrm command reads a text file and removes the specified columns from the file, writing the resulting text to standard output.

To use the colrm command, you will need to specify the starting column number and the number of columns to remove.

To remove the first 3 columns from a text file, use the following command:

# colrm 1 3 < input_file.txt > output_file.txt

This will remove the first 3 columns from the input file and write the resulting text to the output file.

If you encounter the below error while running the command colrm :

colrm : command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install bsdmainutils
Ubuntu apt-get install bsdmainutils
Alpine apk add util-linux
Arch Linux pacman -S util-linux
Kali Linux apt-get install bsdmainutils
CentOS yum install util-linux
Fedora dnf install util-linux
OS X brew install util-linux
Raspbian apt-get install bsdmainutils

colrm Command Examples

1. Remove first column of stdin:

# colrm 1 1

2. Remove from 3rd column till the end of each line:

# colrm 3

3. Remove from the 3rd column till the 5th column of each line:

# colrm 3 5

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to enable additional scsi logging in CentOS/RHEL
  2. How To Add Standard Linux Users To Manage Print Jobs And Services in CentOS/RHEL
  3. Permission Table for a File/Directory And File System Users Types
  4. CentOS / RHEL 6 : How to password protect grub (Password-Protected Booting)
  5. smbget: command not found
  6. btrfs filesystem Command Examples in Linux
  7. detox: Renames files to make them easier to work with
  8. g++: Compiles C++ source files
  9. How to run a cron job on specific days of the week
  10. borg Command Examples (Deduplicating backup tool)

You May Also Like

Primary Sidebar

Recent Posts

  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples
  • “glab mr” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright