What is the proper syntax for only restoring files that are NOT hidden? I'd like to copy those by hand, as needed, without bulk overwriting anything that's already there. So for example, I'd like to ignore the .thumbnails, .cache, .config, etc. but copy everything else. I've tried:

tar zxvf --exclude=.* mybackup.tar.gz

But this didn't work. Any suggestions? Or does this only happen on the backup side, and restore is stuck restoring whatever was tarred?


Try putting the --exclude parameter first and also you must put quotes around the pattern for files you are excluding:

tar --exclude='.*' -zxvf mybackup.tar.gz
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.