tar -cvzf archive.tar.gz .* Template * does not work
How to archive only files / directories with names starting with a dot?
like this:
$ find -maxdepth 1 -regex './\..*' | tar -cvzf archive.tar.gz -T - if you are not satisfied with the prefix ./ before the names of files / directories, then a little longer:
$ find -maxdepth 1 -regex './\..*' -printf '%P\n' | tar -cvzf archive.tar.gz -T - possible without -regex :
$ find -maxdepth 1 -mindepth 1 -name .\* | tar -cvzf archive.tar.gz -T - $ find -maxdepth 1 -mindepth 1 -name .\* -printf '%P\n' | tar -cvzf archive.tar.gz -T - or you can find without it:
$ tar -cvzf archive.tar.gz .??* but files / directories with the name consisting of two characters will not fall under the mask. type .1 . then so
$ tar -cvzf archive.tar.gz .[^.]* .??* files / directories with the name consisting of two characters will not fall. - aleksandr barakinSource: https://ru.stackoverflow.com/questions/546710/
All Articles
".*"- PinkTux\.*? - don Rumata pm