On 24-Jul-99 Andy Goth wrote:
>> well tar include dot files by default. But you should not do:
>>   cd ~ ; tar cfz /tmp/backup.tgz *
>> but
>>   cd ~ ; tar cfz /tmp/backup.tgz .
> 
> I'm pretty sure this wildcard string will expand to be *all* files--dot
> or otherwise.
> 
> [.]*
> 
> "." alone... it looks like it would only match a file called simply "."

That's exactly the intention, because there sort of IS a file (or, more
accruately, a directory) called simply ".".

If you type "ls -a" from any directory in Linux, the first two things you'll
see are "./" and "../".  ./ always refers to the current directory, and ../
always refers to the directory directly above the current directory.  It works
the same way in DOS I believe.

So if you type "tar cfz /tmp/backup.tgz ." from /home/username, it's actually
the same as typing "tar cfz /tmp/backup.tgz /home/username" just more concise. 
Tarring the directory itself also has the convenient effect of tarring
-everything- within the directory, hidden or unhidden, without having to use
wildcards.


-Tom

Reply via email to