https://github.com/ewylson/hist
A simple C program that counts printable ASCII characters in a file and generates a histogram
https://github.com/ewylson/hist
c c99 character-count character-counter histogram
Last synced: 9 months ago
JSON representation
A simple C program that counts printable ASCII characters in a file and generates a histogram
- Host: GitHub
- URL: https://github.com/ewylson/hist
- Owner: ewylson
- License: mit
- Created: 2025-08-20T19:01:17.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-09-02T14:37:49.000Z (9 months ago)
- Last Synced: 2025-09-02T16:14:14.736Z (9 months ago)
- Topics: c, c99, character-count, character-counter, histogram
- Language: C
- Homepage:
- Size: 27.3 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hist
A simple C program that counts printable ASCII characters in a file and generates a histogram.
## Download
You can download the latest or specific version of **hist** from the [Releases](https://github.com/ewylson/hist/releases) page.
### Supported Platforms
| OS | Arch | Libc |
|-------|----------|----------|
| Linux | x86_64 | glibc |
| Linux | x86_64 | musl |
| Linux | i686 | glibc |
| Linux | aarch64 | glibc |
| Linux | aarch64 | musl |
| BSD | x86_64 | freebsd |
## How to use
```
Usage: hist [OPTION]... FILE
Counts printable characters in a file and creates a histogram.
-l, --letters-only count only letters
-d, --digits-only count only decimal digits
-a, --alphanumeric-only count only letters and decimal digits
-p, --punctuation-only count only punctuation marks
-L, --lowercase-letters-only count only lowercase letters among letters
-U, --uppercase-letters-only count only uppercase letters among letters
-C, --case-ignore count identical letters with different case as a single character
-r, --range=SIZE set the histogram range
--help display this help and exit
--version output version information and exit
Examples:
hist file.txt Count all printed characters in the file and display a histogram.
hist -aC file.txt Count only letters and digits in the file, ignoring case, and display a histogram.
```
## Building from Source Code
### Linux
The program can be compiled manually with any C compiler that supports the C99 standard or later, such as GCC or Clang:
```console
cc main.c -o hist -std=c99 -O2
```
## License
This project is licensed under the MIT License.
You are free to use, modify, and distribute it under the terms of that license.