{"id":13646865,"url":"https://github.com/ericlagergren/go-coreutils","last_synced_at":"2025-04-21T21:31:38.180Z","repository":{"id":23781101,"uuid":"27156402","full_name":"ericlagergren/go-coreutils","owner":"ericlagergren","description":"A cross-platform port of GNU's coreutils to Go","archived":true,"fork":false,"pushed_at":"2018-04-29T13:41:54.000Z","size":16416,"stargazers_count":752,"open_issues_count":88,"forks_count":69,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-03-26T09:41:14.934Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericlagergren.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-26T02:39:17.000Z","updated_at":"2025-03-15T23:24:37.000Z","dependencies_parsed_at":"2022-08-22T04:50:54.221Z","dependency_job_id":null,"html_url":"https://github.com/ericlagergren/go-coreutils","commit_stats":null,"previous_names":["ericlagerg/go-coreutils"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericlagergren%2Fgo-coreutils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericlagergren%2Fgo-coreutils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericlagergren%2Fgo-coreutils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericlagergren%2Fgo-coreutils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericlagergren","download_url":"https://codeload.github.com/ericlagergren/go-coreutils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250136746,"owners_count":21380885,"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","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":[],"created_at":"2024-08-02T01:03:11.530Z","updated_at":"2025-04-21T21:31:37.568Z","avatar_url":"https://github.com/ericlagergren.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Go coreutils\n\n[![forthebadge](http://forthebadge.com/images/badges/made-with-crayons.svg)](http://forthebadge.com)\n[![forthebadge](http://forthebadge.com/images/badges/as-seen-on-tv.svg)](http://forthebadge.com)\n\nThis is a port of GNU's coreutils (http://www.gnu.org/software/coreutils/)\nthat aims to be a drop-in, cross-platform replacement.\n\n**It's currently under development.**\n\nBecause it imports from `github.com/EricLagergren/go-gnulib`, and I'm constantly\nrefactoring, parts could break from day-to-day.\n\nI'd recommend running `go get -u ...` before you file a bug report!\n\n*Pull requests are more than welcome.*\n\nAlso, see https://www.github.com/EricLagergren/go-gnulib for a similar project that this project depends on.\n\n### Completed:\n\n* 100% Completion\n * 15/100\n* Partial Completion\n * 2/100\n\n| Utility | Completeness   | Cross Platform      | Need Refactor|\n|:--------|:---------------|:--------------------|:-------------|\n| cat     | 100%           | Yes (Unix/Windows)  | No           |\n| chown   | 0% (* see note #1) | No             | Yes (-R)     |\n| env     | 100%           | Yes (Unix/Windows)  | No           |\n| false   | 100%           | Yes (Unix/Windows)  | No           |\n| logname | 100%           | No                  | No           |\n| pwd     | 100%           | Yes (Unknown)       | No           |\n| sync    | 100%           | Yes (Unix/Windows)  | No           |\n| true    | 100%           | Yes (Unix/Windows)  | No           |\n| tsort   | 100%           | Yes (Unix/Windows)  | No           |\n| tty     | 100%           | Yes (Unix/Windows)  | No           |\n| uname   | 100%           | No                  | No           |\n| uptime  | 90%            | Yes (Unix/Windows, no FreeBSD)  | No           |\n| users   | 100%           | No                  | No           |\n| wc      | 100%           | Yes (Unix/Windows)  | No           |\n| whoami  | 100%           | Yes (Unix/Windows   | No           |\n| xxd     | 100%           | Yes (Unix/Windows)  | No           |\n| yes     | 100%           | Yes (Unix/Windows)  | No           |\n\n* chown note: Currently refactoring from the ground-up.\n\n**Side notes:**\n- Unix *should* include OS X unless otherwise specified.\n- Gofmt means it needs its styling changes (e.g. variable names, formatting, etc.)\n- Idiomatic means it needs to be changed to more idiomatic Go\n- Windows coverage will increase when I get a Windows laptop\n\n### Information:\n\n#### Performance:\n\nObviously there's some things Go can do better (parallelism and concurrency),\nbut for the most part these tools should have nearly the same speed,\nwith Go being slightly slower.\n\n```\neric@archbox $ time ./wc_go -lwmc one_gigabyte_file.txt \n  32386258  146084896 1182425560 1183778772 one_gigabyte_file.txt\n\nreal  0m25.206s\nuser  0m24.900s\nsys   0m0.313s\neric@archbox $ time wc_c -lwmc one_gigabyte_file.txt \n  32386258  146084896 1182425560 1183778772 one_gigabyte_file.txt\n\nreal  0m22.841s\nuser  0m22.570s\nsys   0m0.257s\n```\n\n#### Behavior:\n\nThese utilities should be nearly identical to GNU's coreutils.\n\nSince parsing the output of shell commands isn't uncommon (even if\nit *is* bad behavior), most of the commands should have output that\nis nearly identical to the original GNU commands.\n\nDo note that sometimes the results could differ a little for select commands.\n\nFor example, GNU's `wc` utility relies on the current locale to determine\nwhether it should parse multi-byte characters or not.\n\nThe Go version, on the other hand, uses the `unicode/utf8` package\nwhich natively detects multi-byte sequences. The trade-off is this: the\nGo version is technically more correct, while the C version is faster.\n\nOur implementation of `xxd` is actually much faster than the native `xxd`\nimplementation found on most *nix machines -- try it out!\n\n### REQUIRES:\n\n(Depends on platform and command...)\n- go get github.com/EricLagergren/ostypes\n- go get golang.org/x/sys/unix\n- go get github.com/EricLagergren/go-gnulib/ttyname\n- go get github.com/EricLagergren/go-gnulib/sysinfo\n- go get github.com/EricLagergren/go-gnulib/posix\n- go get github.com/EricLagergren/go-gnulib/general\n- go get github.com/EricLagergren/go-gnulib/login\n\n### LICENSE:\n\n```\n   Copyright (C) 2014-2016 Eric Lagergren\n\n   This program is free software: you can redistribute it and/or modify\n   it under the terms of the GNU General Public License as published by\n   the Free Software Foundation, either version 3 of the License, or\n   (at your option) any later version.\n\n   This program is distributed in the hope that it will be useful,\n   but WITHOUT ANY WARRANTY; without even the implied warranty of\n   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n   GNU General Public License for more details.\n\n   You should have received a copy of the GNU General Public License\n   along with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n```\n\n#### License subnotes:\nIt (as a whole) is licensed under the GPLv3 because it's mostly a\ntransliteration of GNU's coreutils, which are licensed under the GPLv3.\n\nHowever, certain parts have their own licenses (e.g., `xxd` is public domain).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericlagergren%2Fgo-coreutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericlagergren%2Fgo-coreutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericlagergren%2Fgo-coreutils/lists"}