How to list a directory "all except"

sean ritzler sean.a.ritzler at gmail.com
Wed Aug 7 08:12:26 MST 2013


To answer your last question specifically:

ls -ltr | grep -v htm$

I don't know if ls has some sort of exclude option, so I would just use grep.

Sean

On Wed, Aug 7, 2013 at 8:04 AM,  <joe at actionline.com> wrote:
> What syntax would one use to list all the contents
> of a directory *except* those of a specified criteria?
>
> For example, I know that: ls -ltr *htm
> lists all contents ending in 'htm'
>
> But how could I list all contents excluding those ending in 'htm'?
>
>
>
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss at lists.phxlinux.org
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.phxlinux.org/mailman/listinfo/plug-discuss


More information about the PLUG-discuss mailing list