Detect long paths incompatible with OneDrive for Mac


Screen Shot 2015-09-01 at 21.35.28

As a user of OneDrive on MacOS I ran into an issue that OneDrive would hang at the processing files or scanning files stage. After some searching I found that this can be related to having paths with more than 255 characters in the name but how to find those? Well some small bash magic did the trick for me.

cd ~/OneDrive && find `pwd` -name '*' | grep '^.{255}'

This will list all the paths longer than 255 characters for the OneDrive directory located in home.

4 thoughts on “Detect long paths incompatible with OneDrive for Mac

  1. Right idea, but if your OneDrive directory is not in your home directory, you will need to correct this as the ~/OneDrive and the `pwd` won’t work. Instead try:
    CD your-OneDrive-directory
    find . -name ‘*’ | grep ‘^.{255}’

    Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.