Skip to content

gt is a tree-like program written in Go with a lot of features.

License

Notifications You must be signed in to change notification settings

elbachir-one/gt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gt

image-gt

gt, is a command-line tool written in Go that displays a tree of files and directories with colored icons.

Features

  • Displays a tree of files and directories.
  • Supports showing hidden files.
  • Option to unsort files.
  • Displays summary of files and directories.
  • Colored icons based on file types.
  • List directories only.
  • Order files.
  • Print full path.

Installation

  1. Ensure you have Go installed, and also Nerd Fonts

  2. Clone the repository

2-1. Go

    git clone https://github.com/elbachir-one/gt
    cd gt/
    go build
    sudo cp gt /usr/local/bin/gt
    sudo cp gt.1 /usr/local/share/man/man1/ # To copy the man page.
    gt

2-2. Using the Makefile

    git clone --depth 1 https://github.com/elbachir-one/gt
    cd gt/
    make
    sudo make install

Note: gt is in the AUR, and a template is available for Void Linux.

  • Arch Linux
    yay -S gt
  • Void Linux
    git clone --depth=1 https://github.com/void-linux/packages
    cd void-packages/
    ./xbps-src binary-bootstrap
    mkdir srcpkgs/gt
    vim srcpkgs/gt/template # Use you own editor

Past the content of this template to your local template and save it.

    ./xbps-src pkg gt
    sudo xbps-install -R hostdir/binpkgs gt

Usage

    gt
    gt [OPTIONS] [DIRECTORY]

Note: you can also pip gt to fzf or less.

    gt | less -r

gt and less

-r is an option for less to repaint the screen.

    gt | fzf --ansi

gt and fzf

Options:

Option Description example
-h --help Show help -h
-v --version Show version -v
-a --all Show hidden files -s
-u --unsorted Files -u
-m --summary Summary -m
-d --directories List directories only -d
-o --order-by-extension Order files based on extension -o
-f --full-path Print full path prefix to each file -f
--depth Depth to which the tree should be displaye the default is -1 gt --depth 1 any number greater than or equal to 1 can be used. --depth

Contributing

Contributions, issues, and feature requests are always welcome! Thank you.

About

gt is a tree-like program written in Go with a lot of features.

Resources

License

Stars

Watchers

Forks

Packages

No packages published