How can I use the tree command such that the pattern I provide with the -P flag applies to symlinks and directories, as well as normal files? What I'm looking for is globbing behavior loosely equivalent to or better than ls.For instance, an example directory contains the following:$ tree -F. directory/ executable -> /usr/bin/executable* file1.png file2.txt1 directory, 3 filesUsing the -I flag filters out symlinks, just as it does normal files and directories:$ tree -F -I '*' # Expected: empty listing .0 directories, 0 files$ tree -F -I 'exec*' # Expected: everything except 'executable' symlink . directory/ file1.png file2.txt1 directory, 2 files$ tree -F -I 'file*|dir*' # Expected: only 'executable' symlink . executable -> /usr/bin/executable0 directories, 1 fileHowever, the -P flag seems to ignore both directories and symbolic links:$ tree -F -P '*' # Expected: equivalent to simply 'tree -F' . directory/ file1.png file2.txt1 directory, 2 files$ tree -F -P 'exec*' # Expected: only 'executable' symlink . directory/1 directory, 0 files$ tree -F -P 'file*|dir*' # Expected: everything except 'executable' symlink . directory/ file1.png file2.txt1 directory, 2 filesAm I incorrect in thinking that -I is supposed to be the inverse of -P?
Apply 'tree' pattern to symlinks and directories
wildcards;tree