Is it possible to have the ls command behave differently based on the number of directory entries that may be listed?
If I just use
ls (with no modifying options, but I can specify directories or filters), I want it to:
-llong listing format if there are 10 entries or less
- show the first 50 entries only and output a warning that there are
x more entries
Is this possible? How can I do this?
Note that I don't want to
use a custom script command switch to a custom command - I am OK with a custom script or wrapper, but I still want to use
ls to do this, with full functionality still maintained. That is, not
my-custom-ls but just
ls to call the script/wrapper.