{"id":29881909,"url":"https://github.com/dankinder/cl","last_synced_at":"2026-04-19T17:01:20.896Z","repository":{"id":57563920,"uuid":"148387781","full_name":"dankinder/cl","owner":"dankinder","description":"Cl is a tool for filtering data by columns on the command line","archived":false,"fork":false,"pushed_at":"2020-06-15T16:14:06.000Z","size":881,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T06:26:09.013Z","etag":null,"topics":["bash","go","golang"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dankinder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-11T22:26:30.000Z","updated_at":"2024-06-20T06:26:09.014Z","dependencies_parsed_at":"2022-09-16T13:34:46.639Z","dependency_job_id":null,"html_url":"https://github.com/dankinder/cl","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/dankinder/cl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankinder%2Fcl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankinder%2Fcl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankinder%2Fcl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankinder%2Fcl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dankinder","download_url":"https://codeload.github.com/dankinder/cl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankinder%2Fcl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268028551,"owners_count":24183864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","go","golang"],"created_at":"2025-07-31T11:14:43.838Z","updated_at":"2026-04-19T17:01:20.824Z","avatar_url":"https://github.com/dankinder.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Cl is a tool for filtering data by columns on the command line.\n\n\u003ca href=\"https://godoc.org/github.com/dankinder/cl\"\u003e\u003cimg src=\"https://godoc.org/github.com/dankinder/cl?status.svg\" alt=\"GoDoc\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://goreportcard.com/report/github.com/dankinder/cl\"\u003e\u003cimg src=\"https://goreportcard.com/badge/github.com/dankinder/cl\" alt=\"Go Report Card\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://travis-ci.org/dankinder/cl\"\u003e\u003cimg src=\"https://travis-ci.org/dankinder/cl.svg?branch=master\" alt=\"Build Status\" /\u003e\u003c/a\u003e\n\n# What it does\nUsage: `cl [options...] \u003ccolumn_indexes...\u003e`\n\nExamples:\n```bash\n# Filter a simple table of data for the second column:\n$ echo \"1 2 3\n\u003e 4 5 6\n\u003e 7 8 9\" | cl 2\n2\n5\n8\n\n# Grab a list of process IDs from ps, ignoring the header row (-i):\n$ ps | cl 1 -i\n7958\n29855\n\n# Grab the third column of output when there may be spaces, in values, and tabs are the separator (-t):\n$ netstat | cl 3 -t\n\n# Or the first 2 columns:\n$ netstat | cl 1 2 -t\n\n# Or the first 4 columns (in bash):\n$ netstat | cl {1..4} -t\n```\n\nOptions:\n```\n  -i    ignore the header row (first row)\n  -s string\n        a character or regex to split lines (default: whitespace)\n  -t    use tabs as separator (alias of -s \\t)\n```\n\n# Install\n\n```bash\ngo get github.com/dankinder/cl\n```\n\n# Why\nExisting commonly-available bash commands like `awk` and `tail` can accomplish\nwhat `cl` does. But they become quite verbose.\n\nTo select a column with `awk`, you use:\n```sh\nmy_command | awk '{ print $1 }'\n```\n\nBut then, you want to delete the header row too (another very common thing). For that you need:\n```sh\nmy_command | awk '{ print $1 }' | tail -n +2\n```\n\nI used to have the following bash function in my .bashrc, and I'm sure many\nothers have equivalents:\n```bash\n# Grab column N from stdin, ex. `ps aux | cl 2` =\u003e Just Process IDs\nfunction cl() {\n    awk \"{print \\$$1}\"\n}\n\n# Ignore the header row of the input\nfunction ih() {\n\ttail -n +2\n}\n```\n\nFurther, some tools worked around this specific problem by building another\ntool (`pgrep`) giving us yet another command to learn.\n\nIt felt to me like we need a small, simple, generalized tool for this task.\n\nSo I build `cl`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdankinder%2Fcl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdankinder%2Fcl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdankinder%2Fcl/lists"}