lsd-rs / lsd

The next gen ls command
Apache License 2.0
13.16k stars 429 forks source link

[Feature request] Show Windows Attributes when running on Windows #866

Open RaffaeleBianc0 opened 1 year ago

RaffaeleBianc0 commented 1 year ago

Expected behavior

dar-- 28/06/2021 13:33:00 4.0 KB  Users/ When run from a Windows machine, the first column could show the attributes the same way "Get-ChildItem" does on PowerShell on Windows.

Actual behavior

drwxrwxrwx 28/06/2021 13:33:00 4.0 KB  Users/

(thanks for this neat piece of software, i am using it every time!)

zwpaper commented 1 year ago

Hi @RaffaeleBianc0, I am not a windows user, can you explain some more about the dar--?

RaffaeleBianc0 commented 1 year ago

Hi @zwpaper ! I believe those are the 5 standard attributes for Windows files/folders: d=directory a=archive r=read-only s=system h=hidden

I remember that since the old ages of MS-DOS, and I am pretty sure those still apply to the current Windows versions. Maybe there are further attributes above those 5, but I am not sure about this.

domsleee commented 12 months ago

There is also l for links (e.g. symlinks / junctions)

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-childitem?view=powershell-7.3

By default Get-ChildItem lists the mode (Attributes), LastWriteTime, file size (Length), and the Name of the item. The letters in the Mode property can be interpreted as follows:

l (link) d (directory) a (archive) r (read-only) h (hidden) s (system)

eza uses these attributes for windows