Last active
June 2, 2017 18:38
-
-
Save scwood/d0fc7576c8cac37fde1a6b6c39ade808 to your computer and use it in GitHub Desktop.
Using find to only get files in nested directories n levels deep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # So here's my directory structure | |
| # . | |
| # ├── a | |
| # │ └── test.sh | |
| # ├── b | |
| # │ └── test.sh | |
| # └── test.sh | |
| find . -name *.sh | |
| # ./a/test.sh | |
| # ./b/test.sh | |
| # ./test.sh | |
| find ./*/* -name '*.sh' | |
| # ./a/test.sh | |
| # ./b/test.sh | |
| # So if you only wanted files that were three directories deep, you would do ./*/*/* etc. | |
| # Make sense? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment