Skip to content

Instantly share code, notes, and snippets.

@goddoe
Created June 22, 2018 02:31
Show Gist options
  • Save goddoe/3085430f47686669e64217f1d57242d3 to your computer and use it in GitHub Desktop.
Save goddoe/3085430f47686669e64217f1d57242d3 to your computer and use it in GitHub Desktop.
Excluding or including specific file with tree command.
One way is to use patterns with the -I and -P switches:
tree -f -I "bin|unitTest" -P "*.[ch]|*.[ch]pp." your_dir/
The -f prints the full path for each file, and -I excludes the files in the pattern here separated by a vertical bar. The -P switch inlcudes only the files listed in the pattern matching a certain extension.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment