Tree:
JavaScript
x
a.txt (file)
Tests/b.txt (directory)
c.txt (file)
ls :
JavaScript
a.txt
Tests/b.txt
c.txt
Ignore specific file:
ls -I c.txt :
JavaScript
a.txt
Tests/b.txt
Ignore specific directory:
ls -I Tests : (does not work – Tests directory should not appear)
JavaScript
a.txt
Tests/b.txt
c.txt
Advertisement
Answer
The “man page” for the ls
command explains that the -I
flag accepts a pattern. So you can use a wildcard in your command:
JavaScript
ls -I Tests*
See: man ls
or the commands online man page