Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include .htaccess in tar commands? [closed]

Tags:

unix

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.

like image 566
nixnub Avatar asked Oct 25 '09 23:10

nixnub


People also ask

How do I add to an existing tar file?

The simplest way to add a file to an already existing archive is the ' --append ' (' -r ') operation, which writes specified files into the archive whether or not they are already among the archived files. When you use ' --append ', you must specify file name arguments, as there is no default.

What does the command tar XVZF * .tar do?

gz using option -xvzf : This command extracts files from tar archived file. tar.

What is Z in tar command?

z – filter archive through gzip. r – append or update files or directories to the existing archive files. W – Verify an archive file. wildcards – Specify patterns in UNIX tar command.

Where is my .htaccess Linux?

htaccess file can be found at installdir/APPNAME/. htaccess. Some applications do not have the installdir/apache2/conf/vhosts/htaccess/APPNAME-htaccess.


1 Answers

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.

like image 123
Greg Hewgill Avatar answered Oct 07 '22 09:10

Greg Hewgill