Skip to content
Advertisement

ls command ignore specific directory [bash]

Tree:

JavaScript

ls :

JavaScript

Ignore specific file:

ls -I c.txt :

JavaScript

Ignore specific directory:

ls -I Tests : (does not work – Tests directory should not appear)

JavaScript

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

See: man ls or the commands online man page

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement