https://github.com/thenoobgrammer/simple-cli
A small Go project to reproduce a very minimal set of unix cli commands to perform basic os operations.
https://github.com/thenoobgrammer/simple-cli
bash cli unix-command
Last synced: 9 months ago
JSON representation
A small Go project to reproduce a very minimal set of unix cli commands to perform basic os operations.
- Host: GitHub
- URL: https://github.com/thenoobgrammer/simple-cli
- Owner: thenoobgrammer
- Created: 2025-03-16T03:54:36.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2025-03-16T06:49:37.000Z (9 months ago)
- Last Synced: 2025-03-16T07:27:09.514Z (9 months ago)
- Topics: bash, cli, unix-command
- Language: Go
- Homepage:
- Size: 1.16 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Overview
A simple project to recreate some of the basic commands from a Unix shell. The goal is to understand how they work by rebuilding them from scratch, using only Go's system packages.
Here's a link for reference: https://linuxcommand.org/lc3_man_pages/ls1.html
### `ls -a -A --author`
The `ls` command is rather simple but an effective to start learning how to programmatically list directories on your OS. Consider a current `wd`, we read every files using `os.ReadDir(wd)`. Using a process called flag precedence, we can easily take the last flag passed, process it, and return the matching output.