Re: create a tar file from a file list
find -name '.*' finds enverything on account of the working directory being .
Try
Code:
find -regex '\./\.[^/]*' -exec tar -rf newarchive.tar {} \;
The regular expression says the following:
Match files in the current directory (./) whose names begin with a . (. has a special meaning in regular expressions so it is escaped with a backslash) followed by any combination of characters NOT containing a / - thus, for example, you will get ./.local but not ./.local/share and all the other stuff inside it you don't want to append after it has already been added by appending .local.
Note that this will not find hidden files inside non-hidden directories in your home directory, but I doubt you want those - I could get them but I think you don't want them if they exist.
tar -rf just appends its argument to the end of a tar archive, allowing you to use find -regex -exec as your tool (since find -regex -exec has to work one command at a time).
Read man grep for an explanation of regular expressions.
Intel core i5-2400, 8GB RAM, NVIDIA GeForce GTX 550 Ti
Bookmarks