-   Linux - Newbie (
-   -   Syntax for ls with Ignore pattern? (

catalys 10-12-2012 02:08 PM

Syntax for ls with Ignore pattern?
I would like my ls command to exclude files ending with a particular extension, e.g. hoh, so that I do not have to pipe the result to a grep command.

Apparently this can be done with the -I (Ignore) option, but what is the correct syntax?

All these attempts failed (ALL the current folder files were listed):
ls -I[hoh$]
ls -I [hoh$]
ls -I/hoh$/
ls -I /hoh$/

(If only the "--help" function had examples...)


suicidaleggroll 10-12-2012 02:13 PM


ls -I '*hoh'

shivaa 10-12-2012 02:47 PM

You can achive this by using:
ls -la *.<extension>
For example, ls -la *.hoh

All times are GMT -5. The time now is 10:15 AM.