8

Suppose I don't know where my Django source is stored, but I know that it contains these directories in this way: django/contrib/admin.

How can I use the find command or any more appropriate coreutils command to find where this partial directory path (structure) is available?

Example output:

/home/me/python/extracted/django/contrib/admin/
/home/me/env/django/contrib/admin/
1
  • The locate command does this for you, assuming that its database is up to date. Jan 21 '19 at 9:52
8

You should use -path flag for such purpose

find /home/me  -path "*django/contrib/admin*"
1

For people who don't have the -path option (ex: vanilla AIX install, and no GNU find installed), here is another (simple) solution:

find /home/me -print | grep "django/contrib/admin"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.