Search code examples
findubuntu-16.04lsgoogle-drive-realtime-api

find -type d and ls return different results on same directory


I'm trying to think of a reason find would return partial results on Ubuntu 16.04. I have a google drive mount (using plexdrive) located at /home/user/media

When using

find $HOME/media -type d

16 results are returned. When using

ls -d $HOME/media/*/

186 results are returned. The folders are all browsable via sftp and samba shares, all permissions on relevant directories are 775. The content in the media directory is formatted as

a/a.ext
b/b.ext
c/c.ext

Has anyone seen this type of behavior before or have any clues on how to get find to return the full results?


Solution

  • This happens when find is looking at a directory with symbolic links. Use the -L flag to see the proper folder structure. find -L $HOME/media -type d