The next gen ls command

Overview

LSD (LSDeluxe)

license Latest version build codecov versions

Table of Contents

Description

This project is heavily inspired by the super colorls project but with some little differences. For example it is written in rust and not in ruby which makes it much faster.

Screenshot

image

Installation

Prerequisites

Install the patched fonts of powerline nerd-font and/or font-awesome. Have a look at the Nerd Font README for more installation instructions. Don't forget to setup your terminal in order to use the correct font.

See this issue comment for detailed instructions on how to configure iTerm2 font settings correctly.

On Archlinux

pacman -S lsd

On Fedora

dnf install lsd

On Ubuntu

... and other Debian-based Linux distributions

Download the latest .deb package from the release page and install it via:

sudo dpkg -i lsd_0.19.0_amd64.deb # adapt version number and architecture

On Gentoo

sudo emerge sys-apps/lsd

(Ebuild maintained by Georgy Yakovlev)

On macOS

via Homebrew:

brew install lsd

or MacPorts:

sudo port install lsd

On NixOS/From nix

nix-env -iA nixos.lsd

Or add lsd to your configuration.nix like so:

# ...
environment.systemPackages = with pkgs; [
  # other packages ...
  lsd
];
# ...

On FreeBSD

pkg install lsd

On NetBSD

... and other platforms using pkgsrc

Using the package manager:

pkgin install lsd

Building from source:

cd /usr/pkgsrc/sysutils/lsd
make install

On Windows

Install with Scoop:

scoop install lsd

On Android (via Termux)

pkg install lsd

Setup Nerd Fonts in Termux

From Sources

With Rust's package manager cargo, you can install lsd via:

cargo install lsd

If you want to install the latest master branch commit:

cargo install --git https://github.com/Peltoche/lsd.git --branch master

From Binaries

The release page includes precompiled binaries for Linux and macOS.

Configuration

lsd can be configured with a configuration file to set the default options. Check Config file content for details.

Config file location

Non-Windows

On non-Windows systems lsd follows the XDG Base Directory Specification convention for the location of the configuration file. The configuration dir lsd uses is itself named lsd. In that directory it looks first for a file called config.yaml. For most people it should be enough to put their config file at ~/.config/lsd/config.yaml.

Windows

On Windows systems lsd only looks for the config.yaml files in one location: %APPDATA%\lsd\

Config file content

This is an example config file with the default values and some additional remarks.

# == Classic ==
# This is a shorthand to override some of the options to be backwards compatible
# with `ls`. It affects the "color"->"when", "sorting"->"dir-grouping", "date"
# and "icons"->"when" options.
# Possible values: false, true
classic: false

# == Blocks ==
# This specifies the columns and their order when using the long and the tree
# layout.
# Possible values: permission, user, group, size, size_value, date, name, inode
blocks:
  - permission
  - user
  - group
  - size
  - date
  - name

# == Color ==
# This has various color options. (Will be expanded in the future.)
color:
  # When to colorize the output.
  # When "classic" is set, this is set to "never".
  # Possible values: never, auto, always
  when: auto

# == Date ==
# This specifies the date format for the date column. The freeform format
# accepts an strftime like string.
# When "classic" is set, this is set to "date".
# Possible values: date, relative, +<date_format>
date: date

# == Dereference ==
# Whether to dereference symbolic links.
# Possible values: false, true
dereference: false

# == Display ==
# What items to display. Do not specify this for the default behavior.
# Possible values: all, almost-all, directory-only
# display: all

# == Icons ==
icons:
  # When to use icons.
  # When "classic" is set, this is set to "never".
  # Possible values: always, auto, never
  when: auto
  # Which icon theme to use.
  # Possible values: fancy, unicode
  theme: fancy

# == Ignore Globs ==
# A list of globs to ignore when listing.
# ignore-globs:
#   - .git

# == Indicators ==
# Whether to add indicator characters to certain listed files.
# Possible values: false, true
indicators: false

# == Layout ==
# Which layout to use. "oneline" might be a bit confusing here and should be
# called "one-per-line". It might be changed in the future.
# Possible values: grid, tree, oneline
layout: grid

# == Recursion ==
recursion:
  # Whether to enable recursion.
  # Possible values: false, true
  enabled: false
  # How deep the recursion should go. This has to be a positive integer. Leave
  # it unspecified for (virtually) infinite.
  # depth: 3

# == Size ==
# Specifies the format of the size column.
# Possible values: default, short, bytes
size: default

# == Sorting ==
sorting:
  # Specify what to sort by.
  # Possible values: extension, name, time, size, version
  column: name
  # Whether to reverse the sorting.
  # Possible values: false, true
  reverse: false
  # Whether to group directories together and where.
  # When "classic" is set, this is set to "none".
  # Possible values: first, last, none
  dir-grouping: none

# == No Symlink ==
# Whether to omit showing symlink targets
# Possible values: false, true
no-symlink: false

# == Total size ==
# Whether to display the total size of directories.
# Possible values: false, true
total-size: false

# == Symlink arrow ==
# Specifies how the symlink arrow display, chars in both ascii and utf8
symlink-arrow: 

External Configurations

Required

Enable nerd fonts for your terminal, URxvt for example:

.Xresources

URxvt*font:    xft:Hack Nerd Font:style=Regular:size=11

Optional

In order to use lsd when entering the ls command, you need to add this to your shell configuration file (~/.bashrc, ~/.zshrc, etc.):

alias ls='lsd'

Some further examples of useful aliases:

alias l='ls -l'
alias la='ls -a'
alias lla='ls -la'
alias lt='ls --tree'

F.A.Q.

Default Colors

In the future the possibility to customize the colors might be implemented. For now, the default colors are:

User/Group Permissions File Types Last time Modified File Size
#ffffd7 User #00d700 Read #0087ff Directory #00d700 within the last hour #ffffaf Small File
#d7d7af Group #d7ff87 Write #00d700 Executable File #00d787 within the last day #ffaf87 Medium File
#af0000 Execute #d7d700 Non-Executable File #00af87 older #d78700 Large File
#ff00ff Execute with Stickybit #af0000 Broken Symlink #ffffff Non File
#d75f87 No Access #00d7d7 Pipe/Symlink/Blockdevice/Socket/Special
#d78700 CharDevice

UTF-8 Chars

lsd will try to display the UTF-8 chars in file name, A U+FFFD REPLACEMENT CHARACTER(�) is used to represent the invalid UTF-8 chars.

Contributors

Everyone can contribute to this project, improving the code or adding functions. If anyone wants something to be added we will try to do it.

As this is being updated regularly, don't forget to rebase your fork before creating a pull-request.

Credits

Special thanks to:

Comments
  • Is there a way to specify multiple extentions for one icon in the icon theme file?

    Is there a way to specify multiple extentions for one icon in the icon theme file?

    Been using a fork of this project with custom icons but i noticed that you're implementing custom icon themes so I'm switching to that now. One problem is my theme file is cluttered by a ton of repeats, is there a way i can just list a ton of extensions and put one icon for all of them, it would make my file way less cluttered. Or even better would be a way to get em all in one go without worrying about missing an extention, like extention groups. There could be a music group, a video group, etc

    sample of my theme file:

    extension:
      mp3: 
      flac: 
      cue: 
      ape: 
      m4a: 
      opus: 
      ogg: 
      wav: 
      wma: 
      sh: 
      bash: 
      zsh: 
      bashrc: 
      zshrc: 
      csh: 
      cshrc: 
      bash_profile: 
      shell: 
      ps1: 
      ksh: 
      fish: 
      elf: 
      bin: 
      awk: 
    
    kind/feature area/theme 
    opened by OldWorldOrdr 1
  • Folder icons with suffixes displayed incorrectly

    Folder icons with suffixes displayed incorrectly

    • os: Debian GNU/Linux bookworm/sid
    • lsd --version: lsd 0.23.1
    • echo $TERM: alacritty
    • echo $LS_COLORS: rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arc=01;31:.arj=01;31:.taz=01;31:.lha=01;31:.lz4=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.tzo=01;31:.t7z=01;31:.zip=01;31:.z=01;31:.dz=01;31:.gz=01;31:.lrz=01;31:.lz=01;31:.lzo=01;31:.xz=01;31:.zst=01;31:.tzst=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.alz=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.cab=01;31:.wim=01;31:.swm=01;31:.dwm=01;31:.esd=01;31:.avif=01;35:.jpg=01;35:.jpeg=01;35:.mjpg=01;35:.mjpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.webp=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.ogv=01;35:.ogx=01;35:.aac=00;36:.au=00;36:.flac=00;36:.m4a=00;36:.mid=00;36:.midi=00;36:.mka=00;36:.mp3=00;36:.mpc=00;36:.ogg=00;36:.ra=00;36:.wav=00;36:.oga=00;36:.opus=00;36:.spx=00;36:.xspf=00;36:~=00;90:#=00;90:.bak=00;90:.old=00;90:.orig=00;90:.part=00;90:.rej=00;90:.swp=00;90:.tmp=00;90:.dpkg-dist=00;90:.dpkg-old=00;90:.ucf-dist=00;90:.ucf-new=00;90:.ucf-old=00;90:.rpmnew=00;90:.rpmorig=00;90:.rpmsave=00;90:

    test.rs is a folder, not a rust file.

    lsd

    opened by RunThem 1
  • Supress Permission denied (os error 13)" messages when calculating file/dir sizes">

    Supress "lsd: Permission denied (os error 13)" messages when calculating file/dir sizes

    I didn't have this "os error 13' until I turned on calculating file sizes always. I (maybe) understand that the error is just the user running lsd not having access to the file it's trying to get the size of (and maybe some other properties) when trying to create the listing. It would be great to be able to (optionally) suppress these messages for a cleaner output, despite it being somewhat inaccurate.

    opened by Zazucki 1
  • Icon theme with overrides from config

    Icon theme with overrides from config

    • os: debian
    • lsd --version: lsd 0.23.1
    • echo $TERM: Windows Terminal
    • echo $LS_COLORS:

    Current behavior

    Created icons.yaml in ~/config/lsd folder based on example in documentation. Docs says

    "The final set of icons used will be a combination of what is shipped with in lsd with overrides from config applied on top of it".

    However this does not work for me. Icons from what is shipped is gone anď only this in icons.yaml is used.

    Using icon theme. Config.yaml and icons.yaml has a default icon.

    image

    Removing icon theme and now config.yaml and icons.yaml have the icon that is shipped.

    image

    opened by matt70tx 2
  • check isatty for underline in --header

    check isatty for underline in --header

    Fixes #775

    The isatty check code is copied from core.rs

    This PR was drafted very quickly with ripgrep and minimal reading. Hence, it might not be the ideal way to do things. Let me know if you want anything to be changed.


    TODO

    • [x] Use cargo fmt
    • [x] Add necessary tests
    • [x] Add changelog entry
    • [x] Update default config/theme in README (if applicable)
    • [x] Update man page at lsd/doc/lsd.md (if applicable)
    opened by GnikDroy 3
  • Quoting feature is not fully compatible with GNU ls

    Quoting feature is not fully compatible with GNU ls

    • os: Fedora Linux 36 (Workstation Edition) x86_64
    • lsd --version: f5ee0a2b5143b975c277a1c53870c08c6e211c37
    • echo $TERM: alacritty
    • echo $LS_COLORS:

    Expected behavior

    This issue is a follow up from this issue https://github.com/Peltoche/lsd/issues/660 and the note section in this pr https://github.com/Peltoche/lsd/pull/748. The following are list of GNU ls features that involving quoting that are not implemented in lsd yet.

     $ /usr/bin/ls --version
    ls (GNU coreutils) 9.0
    Copyright (C) 2021 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    
    Written by Richard M. Stallman and David MacKenzie.
    
    1. List of command line options involving quoting from man page
           -N, --literal
                  print entry names without quoting
    
           -Q, --quote-name
                  enclose entry names in double quotes
    
           --quoting-style=WORD
                  use quoting style WORD for entry names: literal, locale, shell, shell-always, shell-escape,  shell-es‐
                  cape-always, c, escape (overrides QUOTING_STYLE environment variable)
    

    NOTE: I didn't investigate each behavior of quoting style yet.

    1. GNU ls has better file alignment
    $ /usr/bin/ls -l
    total 100
    -rw-r--r--. 1 teamrakket teamrakket     0 Nov 19 00:42 'a filename with space'
    -rw-r--r--. 1 teamrakket teamrakket  1410 Nov 18 23:55  build.rs
    -rw-r--r--. 1 teamrakket teamrakket 30052 Nov 18 23:55  Cargo.lock
    -rw-r--r--. 1 teamrakket teamrakket  1449 Nov 18 23:55  Cargo.toml
    -rw-r--r--. 1 teamrakket teamrakket 17756 Nov 18 23:55  CHANGELOG.md
    drwxr-xr-x. 1 teamrakket teamrakket    96 Oct 16 02:44  ci
    -rw-r--r--. 1 teamrakket teamrakket    25 Oct 16 02:44  CODEOWNERS
    drwxr-xr-x. 1 teamrakket teamrakket    12 Oct 16 02:44  doc
    -rw-r--r--. 1 teamrakket teamrakket 11359 Oct 16 02:44  LICENSE
    -rw-r--r--. 1 teamrakket teamrakket 19942 Nov 18 23:55  README.md
    -rw-r--r--. 1 teamrakket teamrakket   178 Oct 16 02:46  rustfmt.toml
    drwxr-xr-x. 1 teamrakket teamrakket   192 Nov 18 23:55  src
    drwxr-xr-x. 1 teamrakket teamrakket    72 Oct 16 02:47  target
    drwxr-xr-x. 1 teamrakket teamrakket     0 Nov 19 00:03  test-quote
    drwxr-xr-x. 1 teamrakket teamrakket    28 Oct 16 02:46  tests
    
    $ cargo run -- -l --ignore-config
        Finished dev [unoptimized + debuginfo] target(s) in 0.03s
         Running `target/debug/lsd -l --ignore-config`
    .rw-r--r--. teamrakket teamrakket   0 B  Sat Nov 19 00:42:11 2022  'a filename with space'
    .rw-r--r--. teamrakket teamrakket 1.4 KB Fri Nov 18 23:55:37 2022  build.rs
    .rw-r--r--. teamrakket teamrakket  29 KB Fri Nov 18 23:55:37 2022  Cargo.lock
    .rw-r--r--. teamrakket teamrakket 1.4 KB Fri Nov 18 23:55:37 2022  Cargo.toml
    .rw-r--r--. teamrakket teamrakket  17 KB Fri Nov 18 23:55:37 2022  CHANGELOG.md
    drwxr-xr-x. teamrakket teamrakket  96 B  Sun Oct 16 02:44:26 2022  ci
    .rw-r--r--. teamrakket teamrakket  25 B  Sun Oct 16 02:44:26 2022  CODEOWNERS
    drwxr-xr-x. teamrakket teamrakket  12 B  Sun Oct 16 02:44:26 2022  doc
    .rw-r--r--. teamrakket teamrakket  11 KB Sun Oct 16 02:44:26 2022  LICENSE
    .rw-r--r--. teamrakket teamrakket  20 KB Fri Nov 18 23:55:37 2022  README.md
    .rw-r--r--. teamrakket teamrakket 178 B  Sun Oct 16 02:46:28 2022  rustfmt.toml
    drwxr-xr-x. teamrakket teamrakket 192 B  Fri Nov 18 23:55:37 2022  src
    drwxr-xr-x. teamrakket teamrakket  72 B  Sun Oct 16 02:47:08 2022  target
    drwxr-xr-x. teamrakket teamrakket   0 B  Sat Nov 19 00:03:47 2022  test-quote
    drwxr-xr-x. teamrakket teamrakket  28 B  Sun Oct 16 02:46:28 2022  tests
    
    1. Some character in filename are not get quoted such as ! or (
    $ /usr/bin/ls
    '20 20'   2B+2B   37737    42B42   4DM4D   58X58    63c63   6En6E   79y79		     ci
    '21!21'   2C,2C   38838    43C43   4EN4E   59Y59    64d64   6Fo6F   7Az7A		     CODEOWNERS
    '22"22'   2D-2D   39939    44D44   4FO4F   5AZ5A    65e65   70p70   7B{7B		     doc
     23#23	  2E.2E   3A:3A    45E45   50P50  '5B[5B'   66f66   71q71  '7C|7C'		    'filename with $'
    '24$24'   30030  '3B;3B'   46F46   51Q51  '5C\5C'   67g67   72r72   7D}7D		     LICENSE
     25%25	  31131  '3C<3C'   47G47   52R52   5D]5D    68h68   73s73   7E~7E		     README.md
    '26&26'   32232  '3D=3D'   48H48   53S53  '5E^5E'   69i69   74t74  'a filename with space'   rustfmt.toml
    "27'27"   33333  '3E>3E'   49I49   54T54   5F_5F    6Aj6A   75u75   build.rs		     src
    '28(28'   34434  '3F?3F'   4AJ4A   55U55  '60`60'   6Bk6B   76v76   Cargo.lock		     target
    '29)29'   35535   40@40    4BK4B   56V56   61a61    6Cl6C   77w77   Cargo.toml		     test-quote
    '2A*2A'   36636   41A41    4CL4C   57W57   62b62    6Dm6D   78x78   CHANGELOG.md	     tests
    
    $ cargo run -- --ignore-config
        Finished dev [unoptimized + debuginfo] target(s) in 0.03s
         Running `target/debug/lsd --ignore-config`
     '20 20'   2D-2D   3B;3B   48H48   55U55     62b62   6Fo6F   7C|7C                     README.md
     21!21     2E.2E   3C<3C   49I49   56V56     63c63   70p70   7D}7D                     rustfmt.toml
     '22"22'   30030   3D=3D   4AJ4A   57W57     64d64   71q71   7E~7E                     src
     23#23     31131   3E>3E   4BK4B   58X58     65e65   72r72   'a filename with space'   target
     '24$24'   32232   3F?3F   4CL4C   59Y59     66f66   73s73   build.rs                  test-quote
     25%25     33333   40@40   4DM4D   5AZ5A     67g67   74t74   Cargo.lock                tests
     26&26     34434   41A41   4EN4E   5B[5B     68h68   75u75   Cargo.toml
     "27'27"   35535   42B42   4FO4F   '5C\5C'   69i69   76v76   CHANGELOG.md
     28(28     36636   43C43   50P50   5D]5D     6Aj6A   77w77   ci
     29)29     37737   44D44   51Q51   5E^5E     6Bk6B   78x78   CODEOWNERS
     2A*2A     38838   45E45   52R52   5F_5F     6Cl6C   79y79   doc
     2B+2B     39939   46F46   53S53   60`60     6Dm6D   7Az7A   'filename with $'
     2C,2C     3A:3A   47G47   54T54   61a61     6En6E   7B{7B   LICENSE
    
    opened by TeamTamoad 1
Releases(0.23.1)
Owner
Pierre Peltier
Pierre Peltier
minimalistic command launcher in rust

rrun Note: Apart from the occasional fix, this project is not actively developed anymore. rrun works fine and should run/compile for the time being on

null 105 Nov 18, 2022
Performs distributed command execution, written in Rust w/ Tokio

Concurr: Distributed and Concurrent Command Execution, in Rust This project is dual licensed under MIT and Apache 2.0. Originally inspired by the GNU

Michael Murphy 93 Dec 18, 2022
Super-fast command aliases with arguments.

Bonnie Bonnie is a command aliasing tool. If you have a super-long command that you have to run all the time, Bonnie is for you! Just define the comma

arctic_hen7 58 Dec 22, 2022
A modern alternative to watch command

A modern alternative to watch command

Tavo Annus 7 Oct 7, 2022
LSD (LSDeluxe) - The next gen ls command

LSD (LSDeluxe) Table of Contents Description Screenshot Installation Configuration External Configurations Required Optional F.A.Q. Contributors Credi

Pierre Peltier 8.9k Jan 1, 2023
Next-GEN Confguration Template Generation Language

Sap lang yet another configuration oriented language name comes from Sapphire which is the birthstone of september Language Feature the last expr of t

LemonHX 12 Aug 8, 2022
Next-GEN Confguration Template Generation Language

Sap lang yet another configuration oriented language name comes from Sapphire which is the birthstone of september Language Feature the last expr of t

Sap-Lang 12 Aug 8, 2022
A formal, politely verbose programming language for building next-gen reliable applications

vfpl Pronounced "Veepl", the f is silent A politely verbose programming language for building next-gen reliable applications Syntax please initialize

VFPL 4 Jun 27, 2022
xrd a next-gen server controller for TrackMania Forever and Nations ESWC

xrd is a next-gen server controller for TrackMania Forever and Nations ESWC that is designed to be hassle-free and easily updatable (with a bus factor of 0).

Autumn Leaf 6 Mar 26, 2022
Quickwit - the next-gen search & analytics engine built for logs

Quickwit is the next-gen search & analytics engine built for logs. It is a highly reliable & cost-efficient alternative to Elasticsearch.

Quickwit OSS 2.9k Dec 30, 2022
The true next-gen L7 minecraft proxy and load balancer. Built in Rust.

Lure The true next-gen L7 minecraft proxy and load balancer. Built in Rust, Tokio and Valence. Why? Rust is a powerful programming language and a grea

Sammwy 67 Apr 16, 2023
Le cauet burger gen est un outils très puissant capable de générer des cauet burger ⚠ vous pouvez devenir obèse en l'utilisant trop il est capable de rayer la nasa de la carte

Cauet-burger-generator Le cauet burger gen est un outils très puissant capable de générer des cauet burger ⚠ vous pouvez devenir obèse en l'utilisant

Pinokaille 1 Apr 23, 2022
An experimental next-generation Electron-based text editor

Attention: GitHub has decided not to move forward with any aspect of this project. We'll archive the repository in case anybody finds value here, but

Atom Archive 8.5k Dec 26, 2022
Ray Tracing: The Next Week implementation in Rust

rttnw Ray Tracing: The Next Week implementation in Rust How to run Install Rust: Link here. Run project git clone https://github.com/luliic2/rttnw cd

null 20 Apr 26, 2022
write your next slideshow in rust 🦀, as a self-contained binary 📦.

?? bema Write your next slideshow in rust ?? , as a self-contained binary ?? . ?? DSL See examples/basic.rs. ?? frontends There are several ways you c

Olivier Abdesselam 21 Sep 5, 2022
MASQ Network 121 Dec 20, 2022
A next-generation music player and manager

ouverture A next-generation music player and manager Very much at Work-In-Planning stage now Planned features GUI (localizable) Backend (something lik

Michael B 9 Nov 17, 2022
XIVLauncher: The Next Degeneration

xivlauncher-neo Concept for a XIVLauncher rewrite in Rust, UI via Vue + Tauri. Project setup yarn --cwd gui install Compiles and hot-reloads for deve

null 15 Nov 24, 2022
Your next config manager, written in rust

confy Your next config manager, written in rust Based on uncomfyhalomacro/hmph but written for .ini files instead of json :) Getting started Take a lo

Krishna Ramasimha 2 Nov 3, 2021