Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

myls - My interpretation of the ls(1) command

myls is a highly opinionated ls clone tailored to my own workflow. It does not aim to be compatible with either BSD or GNU ls.

Features

Below are some notable features & differences compared to other ls implementations. This section also serves as my personal roadmap. See Usage for the full list of command-line options.

Implemented

  • Human-readable sizes (always on)
  • File type indicators (always on)
  • Directory item counts in size column (always on)
  • Windows support (custom mode column and path indicator)
  • Git integration
  • Abbreviate home directory with ~ in output
  • Shell completions
  • Coloured output via $LS_COLORS

Planned

  • Header row
  • Natural sorting (e.g. show image_2.png before image_10.png)
  • Combined short flags (e.g. myls -la)
  • Get-ChildItem/dir-like output for Windows

Installation

go install github.com/CatsDeservePets/myls@latest

Usage

usage: myls [-h] [-V] [-a] [-d] [-l] [-r] [-1] [-color WHEN]
            [-dirsfirst] [-git] [-sort WORD] [file ...]

positional arguments:
  file          files or directories to display

options:
  -h, -help     show this help message and exit
  -V, -version  show program's version number and exit
  -a            do not ignore entries starting with .
  -d            list directories themselves, not their contents
  -l            use a long listing format
  -r            reverse order while sorting
  -1            display one entry per line
  -color WHEN   one of: always, auto, never (default: auto)
  -dirsfirst    show directories above regular files
  -git          display git status
  -sort WORD    one of: name, extension, size, time, git (default: name)

environment:
  MYLS_TIMEFMT_OLD, MYLS_TIMEFMT_NEW
                used to specify the time format for non-recent and recent files
  MYLS_DIRS_FIRST
                if set to a true boolean value, enables -dirsfirst by default
  MYLS_GIT      if set to a true boolean value, enables -git by default
  LS_COLORS     used to specify the colours for file types and file names
  NO_COLOR      if set to a non-empty value, disables coloured output by
                default; -color takes precedence

Example output

$ ./myls -l -a -git
drwxr-xr-x    8 Nov 25 17:42 -- ./
drwxr-xr-x   31 Nov 24 00:28 -- ../
drwxr-xr-x   14 Nov 25 17:42 -- .git/
-rw-r--r--   5B Nov 20 22:11 -- .gitignore
-rw-r--r--  50B Nov 20 22:11 -- go.mod
-rw-r--r-- 7.4K Nov 25 17:29 -M main.go
-rw-r--r-- 1.3K Nov 23 23:00 -- misc.go
-rw-r--r-- 1.6K Nov 23 23:00 -- misc_windows.go
-rwxr-xr-x 2.5M Nov 25 17:27 !! myls*
-rw-r--r-- 727B Nov 25 17:38 -- README.md
C:\Programming\myls> .\myls.exe -l -a -git
d----    8 Nov 25 17:42 -- .\
d----   31 Nov 24 00:28 -- ..\
d--h-   14 Nov 25 17:42 -- .git\
-a---   5B Nov 20 22:11 -- .gitignore
-a---  50B Nov 20 22:11 -- go.mod
-a--- 7.4K Nov 25 17:29 -M main.go
-a--- 1.3K Nov 23 23:00 -- misc.go
-a--- 1.6K Nov 23 23:00 -- misc_windows.go
-a--- 2.5M Nov 25 17:27 !! myls.exe*
-a--- 727B Nov 25 17:38 -- README.md

About

my interpretation of the ls(1) command

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages