g

command module
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2023 License: MIT Imports: 7 Imported by: 0

README

g

logo

a powerful ls

CodeFactor Go Report Card wakatime Go AUR license

linux macos windows AUR version

g is a ls alternative with features:

  1. display items with type-specific icons and colors that are easy to be customized
  2. display in various layouts ( grid/across/byline/zero/comma/table/html/json/markdown )
  3. user-friendly options with many aliases
  4. check file git-status when listing entries
  5. highly customizable sort option
  6. cross-platform ( Linux/Windows/MacOS )
  7. option to fuzzy match the path like zoxide with fzf algorithm

Screenshots

image

install

From source

go version required >= 1.20

go install -ldflags="-s -w"  github.com/Equationzhao/g@latest

or Clone this repo

git clone github.com/Equationzhao/g
cd g
go build -ldflags="-s -w" # use -s -w to shrink size
# then add the executable file to your `PATH`
Via package manager

archlinux user can install g from AUR

yay -S g-ls

homebrew: todo

Pre-built executable

just download from release page, extract the gzip and add the executable file to your PATH

usage

g path(s)

with icon

g -si    path
g -icons path

with mod(default) time

g -st        path
g -show-time path
g -time      path

with access/create/mod time

g -st -time-type=access path
g -st -ac/cr/mod path

with fileperm

g -sp         path
g -permission path

with owner/group

g -so    path
g -owner path
g -sg    path
g -group path

with size

g -ss   path
g -size path

show all files, including hidden files

g -sh path
g -a  path

show dir only

g -sd  path
g -dir path

list by line

g -1             path
g -bl            path
g -oneline       path
g -single-column path

show file only with target ext

g -ext=<target ext(s)> path

list in tree

g -t    path
g -tree path

recurse into directories

g -R       path
g -recurse path

limit depth in tree/recurse (default: no limit)

g -t -depth=<level> path
g -R -depth=<level> path

fuzzy search

g -f     path
g -fuzzy path
# eg: g -f in
# /mnt/e/Project/gverything/index
# pathindex.go

disable index update

g -di            path  
g -no-update     path
g -disable-index path

disable color

g -nc        path
g -no-color  path
g -colorless path

set color

g --color=always path
g --color=auto   path # default
g --color=never  path 

show checksum (md5,sha1,sha224,sha256,sha384,sha512,crc32)

g -cs -ca=sha256 path

show git status with icon

g -gs         path
g -git        path
g -git-status path

show git status with char symbol

g -git -git-style=sym path

output in table

g -tb

output in markdown, and render with glow (icons and colors are not supported in markdown )

g -md | glow 

image

...

Shell scripts

generate shell scripts

g --init bash/zsh/fish/pwsh
bash
# add the following command to .bashrc
eval "$(g --init bash)"
# then `source ~/.bashrc`
zsh
# add the following command to .zshrc
eval "$(g --init zsh)"
# then `source ~/.zshrc`
fish
#  add to fish config:
g --init fish | source
#  then `source ~/.config/fish/config.fish`
powershell
# add the following line to your profile
Invoke-Expression (& { (g --init powershell | Out-String) })

use command echo $profile to find your profile path

More options

g.md

custom theme

theme

created by bing

Repography logo / Recent activity Time period

Timeline graph Pull request status graph Trending topics Top contributors

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package slices defines various functions useful with slices of any type.
Package slices defines various functions useful with slices of any type.
cmp

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL