Tar did a weird thing today
I'm so baffled I had to ask – why this behaviour?
cd /var/www/html
tar czf ~/package.tgz admin/* api/* mobile/*
I do this, and the resulting package doesn't include a couple of hidden files – api/.htaccess and admin/.htaccess. However...
cd /var/www/html
tar czf ~/package.tgz *
This time the hidden .htaccess files are there.
Does anybody have enlightenment to offer as to why?
T4V0
in reply to tasankovasara • • •RheumatoidArthritis
in reply to tasankovasara • • •What is the setting in bash for globbing, to control whether * matches dot files
Unix & Linux Stack ExchangeAdverse_Reaction
in reply to tasankovasara • • •The * expands characters, but . is a pattern not a literal character, so it must be specified since you are explicitly using a character search in the first example.
In the second example, the . files are included by default as they are included in the folder that was found to match the character * that was given.
Maybe this helps?
Onno (VK6FLAB)
in reply to tasankovasara • • •You don't need the wildcard, and as others have pointed out, it doesn't include "hidden " dot files by default.
tar -czf ~/package.tgz admin api mobile
balsoft
in reply to tasankovasara • • •*
and.*
for a wildcard to match all files in directory - e.g.tar czf ~/package.tgz admin/* admin/.* api/* api/.* mobile/* mobile/.*
tasankovasara
in reply to balsoft • • •tasankovasara
in reply to tasankovasara • • •MonkderVierte
in reply to tasankovasara • • •