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...) Thanks! |
Code:
ls -I '*hoh' |
You can achive this by using:
ls -la *.<extension> For example, ls -la *.hoh |
All times are GMT -5. The time now is 02:15 AM. |