logo
search
OneDrive File Issues

How to Exclude Folders from OneDrive Sync on Ubuntu

Natalie TaylorNatalie Taylor Oct 8, 2026 869 views

Question details

The user wants to exclude specific directories (such as Documents or Videos) from synchronizing locally when using the OneDrive Client for Linux on Ubuntu.

How to Exclude Folders from OneDrive Sync on Ubuntu
Product
OneDrive Client for Linux
Device & OS
Ubuntu
Scenario
Syncing cloud files to a local Ubuntu machine while preventing large or unnecessary folders from downloading.
Observed behavior
By default, the client synchronizes all files and directories unless client-side filtering options like skip_dir or sync_list are explicitly configured.
Before you start

Ensure you have the latest version of the OneDrive Client for Linux installed and that your default configuration file has been generated in your user directory (usually ~/.config/onedrive/config).

Solution 1Recommended

Configure Client-Side Filtering Using the skip_dir Option

The most efficient way to exclude whole directories from local synchronization is by updating the configuration file with the skip_dir parameter.

The OneDrive Client for Linux supports powerful client-side filtering. Modifying the main configuration file is the standard method to tell the client which directories should be ignored during the sync process.

1
Access the configuration file

Open your terminal and edit the OneDrive configuration file located at ~/.config/onedrive/config using a text editor (for example, run 'nano ~/.config/onedrive/config').

2
Add the skip_dir parameter

Locate or add the 'skip_dir' line in the file. Format it to include the folders you want to exclude, such as: skip_dir = "Documents|Videos".

3
Save and resync

Save your changes and exit the text editor. Finally, run the command 'onedrive --synchronize --resync' in the terminal to apply the new filtering rules.

Configure Client-Side Filtering Using the skip_dir Option
Syntax Formatting: Use the pipe character (|) to separate multiple directories in the configuration string. Avoid adding spaces around the pipe.
Free Microsoft Office alternative

Edit Your Local OneDrive Files on Ubuntu with WPS Office

While managing your OneDrive synchronization on Linux, you need a robust, native office suite to open and edit your documents. WPS Office is fully compatible with Linux environments like Ubuntu, providing a lightweight, fast, and highly compatible alternative to Microsoft Office for all your local files.

Fully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx).Native support for Ubuntu and other major Linux distributions for a seamless local editing experience.Lightweight design that runs smoothly even on older system configurations.Familiar, tabbed user interface for an easy transition from other office software.
QA img-9

Frequently Asked Questions

Why are my excluded folders still downloading during the sync?

If you previously synced those folders before adding them to the skip_dir list, you must run the client with the --resync flag (onedrive --synchronize --resync) to force it to read the new configuration and remove or ignore the previously synced directories.

Can I exclude specific file types instead of entire folders?

Yes, the OneDrive Client for Linux supports the skip_file option. You can add a rule like skip_file = "*.mp4|*.iso" to your configuration file to prevent the client from downloading those specific file types, regardless of the folder they reside in.

Where can I find more help for complex client-side filtering syntax?

For advanced configurations, troubleshooting, and detailed syntax examples, it is highly recommended to consult the official documentation in the OneDrive Client for Linux GitHub repository or ask questions in their GitHub discussions tab.