Open System Preferences and then Privacy & Security. Choose the Privacy tab, and then select Full Disk Access in the menu on the left. Unlock in the bottom left corner, and then drag Terminal.app (or whatever terminal program you use) on to the list.