I want to print a list of all the files I own, so I use the find command, but it is not working properly, it misses some files, so I tried to find those specific files.

In my home folder (say, /us/myuser) I've got a file named test.gz, owned by me.

When I run

find -L . -user myuser -name "test.gz"

It returns the file name properly.

But when I run instead:

find -L .. -user myuser -name "test.gz"

or even

find -L / -user myuser -name "test.gz"

It finds nothing at all.

Does anybody know what can be happening?

I also tried to remove the -L option, and the result is the same.

closed as unclear what you're asking by Kusalananda Mar 29 at 8:33

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Maybe your "find" command is failing at it's opening gambit. You could try this: ` find $PWD/.. -user myuser ....` – Rakesh Sharma Feb 23 '17 at 12:58
  • weird... it works skipping the -L option, but including it, it does not. Anyway, my goal is to list all my files starting from the root folder (/), and that does not work with or without the -L or the $PWD suggestion :-( – Carlos Medina Gallego Feb 23 '17 at 13:49
  • From the find man page it says, if -L is included it follows the sym links. This could cause find: File system loop detected; and slow down find command.Also if you just need files try this find / -user myuser -name "test.gz" -type f – sai sasanka Feb 23 '17 at 15:00
  • 1
    My guess is that one of the parent directories is missing read or execute permissions for your user account. It is possible that when you log in, it can access your home folder because the login process running as root can enter it before it switches to your user account. Check that you can use "cd" to enter all the parent directories. If that works without problems then I would begin to suspect an selinux problem. Check system logs for selinux messages. I Install selinux admin tools and Run 'setenforce 0' as root then try your find command again – Chunko Feb 24 '17 at 1:26
  • What result do you get if you omit both -L and -user? What if you start in the parent directory instead of using ..? – James Youngman Feb 24 '17 at 23:56

Browse other questions tagged or ask your own question.