https://github.com/abhi11210646/wc-tool
Replica of a Linux utility: Word Count (WC)
https://github.com/abhi11210646/wc-tool
cmd coding-challenge coding-interviews go golang wc wc-tool
Last synced: over 1 year ago
JSON representation
Replica of a Linux utility: Word Count (WC)
- Host: GitHub
- URL: https://github.com/abhi11210646/wc-tool
- Owner: abhi11210646
- Created: 2023-12-19T15:36:41.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-07-19T08:58:37.000Z (about 2 years ago)
- Last Synced: 2025-01-26T13:31:10.367Z (over 1 year ago)
- Topics: cmd, coding-challenge, coding-interviews, go, golang, wc, wc-tool
- Language: Go
- Homepage: https://www.ibm.com/docs/en/aix/7.3?topic=w-wc-command
- Size: 4.99 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Build Your Own wc Tool - Coding Challenge
Build the GO program first.
```console
go build -o ./wc ./cmd/main.go
```
Execute:
```console
abhisekhs@abhisekhs-ThinkPad-L490:~/personal/Projects/wc-tool$ ./wc test.txt test2.txt
2 5 12 test.txt
6 8 18 test2222.txt
8 13 30 total
```
```console
abhisekhs@abhisekhs-ThinkPad-L490:~/personal/Projects/wc-tool$ ./wc test.txt
2 5 12 test.txt
```
```console
abhisekhs@abhisekhs-ThinkPad-L490:~/personal/Projects/wc-tool$ ./wc -h
USAGE: wc [OPTIONS] FILE(S)
-c print the byte counts
-l print the newline counts
-w print the word counts
EXAMPLE:
wc -l logs.txt
wc -w logs.txt
wc -l logs.txt logs2.txt
abhisekhs@abhisekhs-ThinkPad-L490:~/personal/Projects/wc-tool$ ./wc test.txt test2.txt test.txt -l -w
2 5 test.txt
6 8 test2.txt
2 5 test.txt
```

```console
abhisekhs@abhisekhs-ThinkPad-L490:~/personal/Projects/wc-tool$ ./wc -h
USAGE: wc [OPTIONS] FILE(S)
-c print the byte counts
-l print the newline counts
-w print the word counts
EXAMPLE:
wc -l logs.txt
wc -w logs.txt
wc -l logs.txt logs2.txt
abhisekhs@abhisekhs-ThinkPad-L490:~/personal/Projects/wc-tool$ ./wc test.txt test2.txt test.txt -l -w
2 5 test.txt
6 8 test2.txt
2 5 test.txt
```