tags:

views:

439

answers:

2

hi,

whenever i do tar -pczf file.tar.gz *

it ignores any .htaccess files, and i can't see in the man how to include it. any ideas?

thanks

+1  A: 

The problem isn't tar; the shell does not include hidden files in *. Do

tar -pczf file.tar.gz * .htaccess

And next time, perhaps this question could be posted on SuperUser.

pavpanchekha
+2  A: 

The shell is expanding * to all files in the current directory that do not start with a dot. This is the same rule that ls uses by default (by convention, files whose names start with a dot are considered "hidden" in Unix). Try instead:

tar -pczf file.tar.gz .

Using . at the end will collect all files in the current directory, including those whose names start with a dot.

Greg Hewgill
You *could* also glob with * .* as in: "tar -pczf file.tar.gz * .*"
pst