GithubHelp home page GithubHelp logo

ls--'s Introduction

Donate - Every tiny cent helps a lot!

ls++ - colorized ls on steroids

GNU/Linux screenshot

USAGE

ls++ [OPTION]... [FILE]...

OPTIONS

Not known parameters will be passed through to ls, so to show hidden files, -a or -A might be added. See ls(1) for more information.

Views

--pf    permissions, file
--psf   permissions, size, file
--tpf   time, permissions, file
--tpsf  time, permissions, size, file (default)
--ptsf  permissions, time, size, file
--potsf permissions, owners, time, size, file

INSTALLATION

Packages exist for several linux distributions:

Archlinux

pacman -S ls++

SUSE

yast -i ls++

Other / Bleeding edge

I recommend using the cpanminus cpan client and doing a

alias cpan=cpanm

in your shellrc. The program will be there in your normal repositories. :)

# cpanm Term::ExtendedColor File::LsColor
$ git clone git://github.com/trapd00r/ls--.git
$ cd ls--
$ perl Makefile.PL
$ make && su -c 'make install'

$ cp ls++.conf $HOME/.ls++.conf

Install from git locally in your $HOME:

$ mkdir -p $HOME/lib/perl5
$ export PERL5LIB=${HOME}/lib/perl5
$ export PERL_MM_OPT="INSTALL_BASE=${PERL5LIB}"
$ cpanm Term::ExtendedColor File::LsColor

$ git clone git://github.com/trapd00r/ls--.git
$ cd ls--
$ perl Makefile.PL
$ make
$ make install

$ cp ls++.conf $HOME/ls++.conf

Install from CPAN locally; managing dependencies automatically:

$ mkdir -p $HOME/lib/perl5
$ export PERL5LIB=${HOME}/lib/perl5
$ export PERL_MM_OPT="INSTALL_BASE=${PERL5LIB}"
$ cpan App::lsplusplus

If you want to install it globaly, you just skip the first three steps and run the cpan command as root.

Mac OS X Installation

# cpan Term::ExtendedColor File::LsColor
$ git clone git://github.com/trapd00r/ls--.git
$ cd ls--
$ perl Makefile.PL
$ make && sudo 'make install'

$ cp ls++.conf $HOME/.ls++.conf

HISTORY

I wanted to re-arrange the ls output just like one can do with the -printf option to GNU find. Sadly, there are no -printf option available for ls, so I threw together a quick hack called 'pilsner' that did what I wanted and nothing more, nothing less. Not very useful to others.

Mattias Svanström crafted together the 'l' application which did basically the same thing but more elegant and with a nice twist; it calculated relative mtimes.

I really liked that idea, but there were a couple of annoyances, so I forked the project and added a configuration file, support for flags that'll control the different views and possibility to ignore as well as highlight specific files.

AUTHOR

\ \ | / /
 \ \ - /
  \ | /
  (O O)
  ( < )
  (-=-)

Magnus Woldrich
CPAN ID: WOLDRICH
[email protected]
http://japh.se

CONTRIBUTORS

Mattias Svanström

Gregory Sacre

Shelby Munsch - extensive macos work

COPYRIGHT

Copyright 2010, 2011, 2018 the ls++ AUTHOR and CONTRIBUTORS as listed above.

SEE ALSO

l

pilsner

ls--'s People

Contributors

anthraxx avatar doomhammer avatar glubsy avatar jarvvski avatar korjavin avatar tfylling avatar trapd00r avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ls--'s Issues

Missing space after permissions for first entry

Regardless of ls++'s options or folder content, the first line is always missing a space for me.

IOW, ls++ prints eg. "drwxr-xr-x<one space>▏" instead of "drwxr-xr-x<two spaces>|" as for the remaining lines (markup filtered).

Using updated Arch Linux.

ls++ *

Doesn't work in Mac OS, possibly doesn't work in Linux?

Do not show hidden files by default

Issue originally reported by Stephen Duvick (@sduvick):

I love the colors and style of ls++, and would like to replace my regular ls with it, but the large amount
of dotfiles gets frustrating and cumbersome. Is there any way that I can ignore dotfiles in ls++?

Can't Locate Term Color

Can't locate Term/ExtendedColor.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /usr/local/bin/ls++ line 10.
BEGIN failed--compilation aborted at /usr/local/bin/ls++ line 10.

Should probably put what dependencies are needed in order to use this in the Readme

You should add this line into the Readme


To install on Ubuntu you will need two color modules and can be installed easily using cpan

su -
cpan Term::ExtendedColor Term::ExtendedColor::Xresources

Setup own colour

I love the colours but there is only 4 colour scheme in config file.Can I all more colour schemes in it or ho can I change the pre-difined colours.

Also can I add colours in the folder's name section too?The folder's name section shows colours as normal ls do.

Remove dot (SELinux)

GNU `ls' uses a '.' character to indicate a file with an SELinux security context:

SELinux

--- ls++-org    2013-09-27 14:43:29.838145066 +0300
+++ ls++        2013-09-27 14:43:34.965145068 +0300
@@ -351,6 +351,7 @@
   $perm =~ s/(S)/fg($c[8],  $1)/eg;
   $perm =~ s/(t)/fg($c[8],  $1)/eg;
   $perm =~ s/(T)/fg($c[8],  fg('bold', $1))/eg;
+  $perm =~ s/\.//g;

   return $perm;
 }

[SOLVED] Display file owner/group

I may be missing something, but I don't see a way to enable/display file owner/group with ls++, similar to how "/bin/ls -l" would display a directory tree.

EDIT: Oh gosh, I'm an idiot. My alias was covering up my use of the "--potsf" flag, causing me to derp a bit more than usual. Sorry! Feel free to close this.

[ WISH ] Show file permissions in octal format

Hello all,
Longtime ls++ fan here.
If you guys ever have the time I think it would be cool to add octal capabilities to the ls listing like I use with the traditional GNU ls:

...
 664 -rw-rw-r--. 1 msx msx 117K May 25 12:16 Screenshot from 2015-05-25 12:15:58.png
 777 lrwxrwxrwx. 1 msx msx   31 Apr 10 20:32 Soulseek Chat Logs -> /home/@data/Soulseek Chat Logs//
 777 lrwxrwxrwx. 1 msx msx   17 Mar 24 23:42 Stash -> /home/@data/Stash/
 777 lrwxrwxrwx. 1 msx msx   21 Feb 16 14:31 Templates -> /home/@data/Templates/
 664 -rw-rw-r--. 1 msx msx  52K May 18 18:33 TIGO_MFS_Manual Tecnico_v1.odt
 640 -rw-r-----. 1 msx msx  13K May 22 18:22 TIGO.png
 777 lrwxrwxrwx. 1 msx msx   18 Feb 16 14:31 Videos -> /home/@data/Videos/
 664 -rw-rw-r--. 1 msx msx  484 May  5 20:56 VM_GH
 777 lrwxrwxrwx. 1 msx msx   15 Feb 16 14:31 VMs -> /home/@data/VMs/
 640 -rw-r-----. 1 msx msx 988K May  4 00:30 yunrl7fmeiespkovaghp.jpg

To achieve this, I use this beautiful awk command - kudos to its creator:

awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf(" %0o ",k);print}'

Like:

/usr/bin/ls -lha --group-directories-first --color -F | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf(" %0o ",k);print}'

Cheers

zsh: command not found: ls++

install steps i took:

$ cpan App::lsplusplus

cpan Term::ExtendedColor File::LsColor

$ git clone git://github.com/trapd00r/ls--.git
$ cd ls--
$ perl Makefile.PL
$ make && sudo 'make install'

$ cp ls++.conf $HOME/.ls++.conf

i tried sudo cpan also with no avail =L

Mac OS X: bad alignment / size unit

Hi,

I've just installed ls-- on Mac OS 10.9.4 with defaut configuration (OSX & ls--).
While I execute ls--, I see that:

bash-3.2$ ls++
▕-rw-r--r--▏<  min │      24857B16B│MANIFEST
▕-rw-r--r--▏<  min │        1071.1107K16│MYMETA.json
▕-rw-r--r--▏<  min │     248601B16B│MYMETA.yml
▕-rw-r--r--▏<  min │         10727107K16│Makefile
▕-rw-r--r--▏<  min │        1072.1107K16│Makefile.PL
▕-rw-r--r--▏<  min │        1072.3107K16│README.md
▕drwxr-xr-x▏38 sec │     248272B16B│blib
▕-rwxr-xr-x▏<  min │         10714107K16│ls++
▕-rw-r--r--▏<  min │        1074.0107K16│ls++.conf
▕-rw-r--r--▏38 sec │       2480B16B│pm_to_blib
bash-3.2$ pwd
/Users/me/ls--

The file size seems strange.
Do you have an idea?

Thx

Suggestion: Add to Ruby gems

It'd be nice if you could gem this up. That sort of helps with remembering to keep this (and a bazillion other things) up to date.

[Solved] Bug when listing files

If a file starts with a number, it is eaten by the ls-- parser:

$ touch "2013-02-02 file"
$ ls++
-rw-r--r--▏<  sec │   0B│file

Use global ls instead of /bin/ls on Darwin

ls++ uses strictly /bin/ls on Darwin platform. If someone is not happy Darwin's ls command and installs GNU coreutils (by home-brew or macports), ls++ should use globally defined ls command instead of /bin/ls. I know you need to know wether ls is belong to Darwin or Coreutils or not; but I'm sure there is an elegant way to distinct them somehow. For instance;

Coreutils ls command accepts --version argument and prints the version and author.

$ ls --version

ls (GNU coreutils) 8.21
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://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.

But Darwin's ls command throws error and prints a simple usage information.

$ /bin/ls --version

/bin/ls: illegal option -- -
usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]

This can be used to distinct them or User can define in ls++.conf which ls command he has. If this issue is solved, @trapd00r can focus only to Coreutils side and if someone wants to use ls++, He can install coreutils and be happy. :) Little work, big benefit.

Garbled Output

I have installed this on Arch Linux and am getting a message

Wide character in printf at /usr/bin/vendor_perl/ls++ line 318, <$ls> chunk 1.

ls++

Sizes are not aligned.

Screenshot_20200608_015420

I think the sizes should be aligned because both 6,9K and 128B have the same number of characters, and that would also make the file names aligned. Or is this a feature? Because I just checked and README files have different colors, maybe LICENSE has a different alignment, but it looks ugly anyway so if this is a feature it would be better with a different color instead.

Space in group name causes errors

I'm trying to use ls++ on a work machine running OSX. My user is part of a corporate domain group that contains a space.

Line 139 of ls++ is just matching on one or more spaces ("\s+"), so naturally for every file owned by my user:group, the output of ls gets split incorrectly and I end up with errors like:

Day 'Jan' out of range 1..31 at ./ls++ line 155.

I've spent literally 0 time beyond that for potential fix. I will tinker around, but I don't know perl too well.

disrespect of XDG_CONFIG_HOME

commit 4ee216e has undone some important loading points especially for distro packaging.

However what is really hurtful that it now only accepts polluting files in the root of $HOME which is really discouraged nowadays. Please consider reverting back or at least support XDG_CONFIG_HOME with a default fallback of $HOME/.config/ls++/ls++.conf

Config file not found and debug printed

I can only run ls++ in the cloned git repository. Otherwise it hangs because it cannot find the configuration file. Also, some debug messages are printed and the output is not correctly aligned.

I've done the installation as instructed and no errors occured. I'm unsure where to look for the source of the issues, but I'll gladly give additional diagnostics if I just knew what to look for.

This screenshot shows the action.

Directory change message swallowed

If you call ls with asterisk names it prints out the folders, for example:

$ ls -l spec/*
-rw-r--r-- 1 hron users 2206 márc  21 01.10 spec/spec_helper.rb

spec/controllers:
total 24
-rw-r--r-- 1 hron users 6480 máj    3 22.48 aliases_controller_spec.rb
-rw-r--r-- 1 hron users  542 márc  21 01.10 dashboard_controller_spec.rb
-rw-r--r-- 1 hron users 6828 máj    3 21.37 mailboxes_controller_spec.rb
-rw-r--r-- 1 hron users 2685 márc  21 01.10 posts_controller_spec.rb

spec/fixtures:
total 0

spec/helpers:
total 0
-rw-r--r-- 1 hron users 0 máj    3 22.48 .gitkeep

But ls++ eats these helpful lines. Can you print out them (at least as it appears)?

File colors are lost

Screenshot

This is a fresh install without any modification on the ls++ basic config file.

Did I miss something ?

Filesize

Hi,

Currently on a Debian Squeeze trough SSH on bash, I'm getting weird file sizes:

▕ drwxr-xr-x▏8 mon │ 1074.0107K16 │Doctrine
▕ drwxr-xr-x▏8 mon │ 1074.0107K16 │Mandango
▕ drwxr-xr-x▏8 mon │ 1074.0107K16 │SwiftMailer
▕ drwxr-xr-x▏8 mon │ 1074.0107K16 │Zend
▕ drwxr-xr-x▏2 mon │ 1074.0107K16 │xhprof_lib
▕ -rw-r--r--▏7 mon │ 1072.6107K16 │Cache.php

Someone has a tip?

Thanks

License

What license is ls++ published under?

Thanks

Add an extra space before filename

For better reading, it would be useful if there can be a space before file names. Currently with some font setup the first letter can touch the separator line of filename column, especially if filename starts with l or underscore.

No color and incorrect formatting on gentoo

Hello,

This is the output on a new machine (gentoo distro) with ls++

ls++
drwxrxrx7 hour 4K bin
drwxrxrx4 day 4K boot
drwxrxrx2 day 3.7K dev
drwxrxrx25 sec 4K etc
drwxrxrx< day 4K home
drwxrxrx3 day 4K lib32
drwxrxrx26 hour 4K lib64
drwxrxrx4 day 4K media
drwxrxrx< day 4K mnt
drwxrxrx4 day 4K opt
drxrxrx2 day 0B proc
drwx8 hour 4K root
drwxrxrx4 day 4K run
drwxrxrx< day 4K sbin
drxrxrx2 day 0B sys
drwxrwxrwt29 sec 720B tmp
drwxrxrx4 day 4K usr
drwxrxrx3 day 4K var
lrwxrwxrwx3 day 5B lib lib64
rwrr4 day 162M stage3-amd64-20130130.tar.bz2

perl --version

This is perl 5, version 16, subversion 2 (v5.16.2) built for x86_64-linux
(with 22 registered patches, see perl -V for more detail)

Copyright 1987-2012, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

This is the output on a different box on which ls++ works like a charm.

ls++
│drwxr xr x│8 day │ 4K│bin
│drwxr xr x│8 day │ 1K│boot
│drwxr xr x│2 day │ 3.7K│dev
│drwxr xr x│27 min │ 4K│etc
│drwxr xr x│7 mon │ 4K│etc.original
│drwxr xr x│23 day │ 4K│home
│drwxr xr x│4 mon │ 4K│include.to_delete
│drwxr xr x│7 day │ 4K│lib
│drwx │7 mon │ 16K│lost+found
│drwxr xr x│5 day │ 4K│mnt
│drwxr xr x│< mon │ 4K│opt
│dr xr xr x│2 day │ -B│proc
│drwxr x │13 day │ 4K│root
│drwxr xr x│< day │ 120B│run
│drwxr xr x│7 day │ 4K│sbin
│dr xr xr x│2 day │ -B│sys
│drwxrwxrwt│37 sec │ 700B│tmp
│drwxr xr x│24 hour│ 4K│usr
│drwxr xr x│5 day │ 4K│var
│ rw r r │7 mon │ 247M│crux-2.7.1-x86_64-updated.iso
│lrwxrwxrwx│< mon │ 3B│lib64 =>lib

Any suggestions on what I could be missing, please?

Thanks
Joe

Makefile fails when /usr/local/etc/ directory present.

Here be logs.
Ubuntu Gnome 16.04:

cp ls++ blib/script/ls++
"/usr/bin/perl" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/ls++
Manifying 2 pod documents
"/usr/bin/perl" -pi -e "s|\"/etc/ls\+\+\.conf|\"/usr/local/etc/ls++.conf|g" ls++
Appending installation info to /usr/local/lib/x86_64-linux-gnu/perl/5.22.1/perllocal.pod
[ ! -d /usr/local/etc ] && mkdir -p /usr/local/etc
Makefile:889: recipe for target 'install_vendor' failed
make: *** [install_vendor] Error 1

Output changed when piped

I've noticed that the output change when the command is piped ( I don't know if it's the expected behavior ).

ls++ dir1/ dir2/ just list the content
ls++ dir1/ dir2/ | grep . list the content and display the directories name, like with /bin/ls

Can't locate Term/ExtendedColor in @INC (macOS)

I've used the cpan::ExtendedColor as included in the readme

I've also tried manually installing via the tar on CPANs site.

The files seem to be in '$HOME/.cpan/builds' but @inc is looking in:

/usr/local/Cellar/perl/5.24.0_1/lib/perl5/site_perl/5.24.0/darwin-thread-multi-2level /usr/local/Cellar/perl/5.24.0_1/lib/perl5/site_perl/5.24.0 /usr/local/Cellar/perl/5.24.0_1/lib/perl5/5.24.0/darwin-thread-multi-2level /usr/local/Cellar/perl/5.24.0_1/lib/perl5/5.24.0 /usr/local/lib/perl5/site_perl/5.24.0

macOS Sierra 10.12.2

Any ideas @trapd00r ?

Ubuntu 18.04 packet not existing

According to the readme ls++ should exist as package in Ubuntu/Debian. This doesn't seem to be the case for ubuntu 18.04 (server version).

Is this just a case of the package is missing or is the readme wrong?

Weird results on Amazon EC2 instance

Here is the kind of things I obtain when doing a ls

[ec2-user@ip-10-234-187-90]~❯ ls
▕ drwx--S---▏44 year│ 2481369100822B16 │bin/
▕ drwx--S---▏44 year│ 2481369100822B16 │cron-scripts/
▕ drwx--S---▏44 year│ 2481369100822B16 │data-scrapping/
▕ drwx--S---▏44 year│ 2481369100822B16 │local/
▕ drwx--S---▏44 year│ 2481369100822B16 │tmp/
▕ -rw-------▏44 year│ 2481369100822B16 │README.md

In Mac OS not showing last modified and size

Using Mac OS X Lion (10.7.1) the size and last modified columns are blank.
Screenshot: http://i.imgur.com/hrBPn.png

Using DEBUG=1, this was the output

237 x
131 x
107 x
61 x
240 x
209 x
185 x
216 x
220 x
208 x
243 x
161 x
240 x
21 x
248 x
196 x
16 x
▕-rw-r--r--▏ B│MANIFEST
▕-rw-r--r--▏ B│Makefile
▕-rw-r--r--▏ B│Makefile.PL
▕-rw-r--r--▏ B│README.md
▕-rwxr-xr-x▏ B│ls++
▕-rw-r--r--▏ B│ls++.conf

Doesn't work on FreeBSD 10

Hi,

I've installed and compiled it on FreeBSD 10, but it complains that the ls command doesn't have a -v flag.
Which is true, nor does it have a corresponding one that does "natural sort of (version) number within text".
The I installed sysutils/coreutils package on FreeBSD, which has a gls command, the GNU ls, which has the -v flag, but if I replace the /bin/ls command with this one, it complains that "invalid tab size: h".
This is in get_ls_cmdline function.
If I put 8 after T, it works, but the file sizes are not displayed.

What do you think can be done?

Thanks,
robcsi

Day 'Dec' out of range

$ ls++
Day 'Dec' out of range 1..31 at /usr/local/bin/ls++ line 158

perl 5.14.2 on OS X 10.6.8

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.