cd $ORACLE_GG tree -L 2 --noreport $(ls -d dir* | grep -v '^dirdat$')
Minimalistic Oracle contains a collection of practical examples from my encounters with Oracle technologies. When relevant, I also write about other technologies, like Linux or PostgreSQL. Many of the posts starts with "how to" since they derive directly from my own personal experience. My goal is to provide simple examples, so that they can be easily adapted to other situations.
Wednesday, July 9, 2025
How to list all subdirectories and exclude certain subdirectories in a tree-like fashion
In this example I want to see all subdirectories that starts with "dir", but also to exclude the directory "dirdat":
ls -d dir*: lists all dir* entries (only directories if they match)
grep -v '^dirdat$': removes dirdat from the list
$(...): expands the filtered list as arguments to tree
No comments:
Post a Comment