An open API service indexing awesome lists of open source software.

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.

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.