How to zip all files including hidden files to zip file using linux command? [closed]

Clash Royale CLAN TAG#URR8PPP
up vote
-1
down vote
favorite
I have linux hosting and wanted to zip everything in one single zip file but all time .htaccess file is excluded and other hidden files are not adding to zip file.
command zip htaccess
closed as unclear what you're asking by Jeff Schaller, Timothy Martin, h3rrmiller, njsg, GAD3R Feb 10 at 10:02
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, itâÂÂs hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |Â
up vote
-1
down vote
favorite
I have linux hosting and wanted to zip everything in one single zip file but all time .htaccess file is excluded and other hidden files are not adding to zip file.
command zip htaccess
closed as unclear what you're asking by Jeff Schaller, Timothy Martin, h3rrmiller, njsg, GAD3R Feb 10 at 10:02
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, itâÂÂs hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
It's better if you don't create tarbombs.
â ams
Feb 9 at 11:46
2
How are you creating the zip file?
â Jeff Schaller
Feb 9 at 11:53
add a comment |Â
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I have linux hosting and wanted to zip everything in one single zip file but all time .htaccess file is excluded and other hidden files are not adding to zip file.
command zip htaccess
I have linux hosting and wanted to zip everything in one single zip file but all time .htaccess file is excluded and other hidden files are not adding to zip file.
command zip htaccess
asked Feb 9 at 11:28
Parth Kundariya
63
63
closed as unclear what you're asking by Jeff Schaller, Timothy Martin, h3rrmiller, njsg, GAD3R Feb 10 at 10:02
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, itâÂÂs hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as unclear what you're asking by Jeff Schaller, Timothy Martin, h3rrmiller, njsg, GAD3R Feb 10 at 10:02
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, itâÂÂs hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
It's better if you don't create tarbombs.
â ams
Feb 9 at 11:46
2
How are you creating the zip file?
â Jeff Schaller
Feb 9 at 11:53
add a comment |Â
It's better if you don't create tarbombs.
â ams
Feb 9 at 11:46
2
How are you creating the zip file?
â Jeff Schaller
Feb 9 at 11:53
It's better if you don't create tarbombs.
â ams
Feb 9 at 11:46
It's better if you don't create tarbombs.
â ams
Feb 9 at 11:46
2
2
How are you creating the zip file?
â Jeff Schaller
Feb 9 at 11:53
How are you creating the zip file?
â Jeff Schaller
Feb 9 at 11:53
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
3
down vote
I suppose, you try something like
zip /path/to/your/zipfile *
but * doesn't match filenames starting with a dot. But ? matches a dot, so ?* matches all file names, including those starting with a dot. Unfortunally it also matches .., the parent directory, so do
zip /path/to/your/zipfile ??*
This will match everything in the current directory.
add a comment |Â
up vote
1
down vote
One thing to note is if you are using a wildcard such as tar -cvpzf your_zip.tgz * it will not include hidden files. However, if you specify the directory such as tar -cvpzf your_zip.tgz /path/to/dir it will work. Or moreover, if you would like to run in your current directory:
tar -cvpfz your_zip.tgz --exclude=*.tgz .
They did say "zip" several times in the title, question, and tags, so a 'tar' answer a little off-target. Your idea is almost there, too -- when given a wildcard source, tar would actually include hidden files of subdirectories, just not (by default) of the current directory.
â Jeff Schaller
Feb 9 at 11:55
add a comment |Â
up vote
1
down vote
The easiest way is to tell your shell to include hidden files in globs. With bash this is done with shopt -s dotglob.
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
I suppose, you try something like
zip /path/to/your/zipfile *
but * doesn't match filenames starting with a dot. But ? matches a dot, so ?* matches all file names, including those starting with a dot. Unfortunally it also matches .., the parent directory, so do
zip /path/to/your/zipfile ??*
This will match everything in the current directory.
add a comment |Â
up vote
3
down vote
I suppose, you try something like
zip /path/to/your/zipfile *
but * doesn't match filenames starting with a dot. But ? matches a dot, so ?* matches all file names, including those starting with a dot. Unfortunally it also matches .., the parent directory, so do
zip /path/to/your/zipfile ??*
This will match everything in the current directory.
add a comment |Â
up vote
3
down vote
up vote
3
down vote
I suppose, you try something like
zip /path/to/your/zipfile *
but * doesn't match filenames starting with a dot. But ? matches a dot, so ?* matches all file names, including those starting with a dot. Unfortunally it also matches .., the parent directory, so do
zip /path/to/your/zipfile ??*
This will match everything in the current directory.
I suppose, you try something like
zip /path/to/your/zipfile *
but * doesn't match filenames starting with a dot. But ? matches a dot, so ?* matches all file names, including those starting with a dot. Unfortunally it also matches .., the parent directory, so do
zip /path/to/your/zipfile ??*
This will match everything in the current directory.
answered Feb 9 at 13:24
Philippos
5,90211545
5,90211545
add a comment |Â
add a comment |Â
up vote
1
down vote
One thing to note is if you are using a wildcard such as tar -cvpzf your_zip.tgz * it will not include hidden files. However, if you specify the directory such as tar -cvpzf your_zip.tgz /path/to/dir it will work. Or moreover, if you would like to run in your current directory:
tar -cvpfz your_zip.tgz --exclude=*.tgz .
They did say "zip" several times in the title, question, and tags, so a 'tar' answer a little off-target. Your idea is almost there, too -- when given a wildcard source, tar would actually include hidden files of subdirectories, just not (by default) of the current directory.
â Jeff Schaller
Feb 9 at 11:55
add a comment |Â
up vote
1
down vote
One thing to note is if you are using a wildcard such as tar -cvpzf your_zip.tgz * it will not include hidden files. However, if you specify the directory such as tar -cvpzf your_zip.tgz /path/to/dir it will work. Or moreover, if you would like to run in your current directory:
tar -cvpfz your_zip.tgz --exclude=*.tgz .
They did say "zip" several times in the title, question, and tags, so a 'tar' answer a little off-target. Your idea is almost there, too -- when given a wildcard source, tar would actually include hidden files of subdirectories, just not (by default) of the current directory.
â Jeff Schaller
Feb 9 at 11:55
add a comment |Â
up vote
1
down vote
up vote
1
down vote
One thing to note is if you are using a wildcard such as tar -cvpzf your_zip.tgz * it will not include hidden files. However, if you specify the directory such as tar -cvpzf your_zip.tgz /path/to/dir it will work. Or moreover, if you would like to run in your current directory:
tar -cvpfz your_zip.tgz --exclude=*.tgz .
One thing to note is if you are using a wildcard such as tar -cvpzf your_zip.tgz * it will not include hidden files. However, if you specify the directory such as tar -cvpzf your_zip.tgz /path/to/dir it will work. Or moreover, if you would like to run in your current directory:
tar -cvpfz your_zip.tgz --exclude=*.tgz .
answered Feb 9 at 11:39
Jaken551
1678
1678
They did say "zip" several times in the title, question, and tags, so a 'tar' answer a little off-target. Your idea is almost there, too -- when given a wildcard source, tar would actually include hidden files of subdirectories, just not (by default) of the current directory.
â Jeff Schaller
Feb 9 at 11:55
add a comment |Â
They did say "zip" several times in the title, question, and tags, so a 'tar' answer a little off-target. Your idea is almost there, too -- when given a wildcard source, tar would actually include hidden files of subdirectories, just not (by default) of the current directory.
â Jeff Schaller
Feb 9 at 11:55
They did say "zip" several times in the title, question, and tags, so a 'tar' answer a little off-target. Your idea is almost there, too -- when given a wildcard source, tar would actually include hidden files of subdirectories, just not (by default) of the current directory.
â Jeff Schaller
Feb 9 at 11:55
They did say "zip" several times in the title, question, and tags, so a 'tar' answer a little off-target. Your idea is almost there, too -- when given a wildcard source, tar would actually include hidden files of subdirectories, just not (by default) of the current directory.
â Jeff Schaller
Feb 9 at 11:55
add a comment |Â
up vote
1
down vote
The easiest way is to tell your shell to include hidden files in globs. With bash this is done with shopt -s dotglob.
add a comment |Â
up vote
1
down vote
The easiest way is to tell your shell to include hidden files in globs. With bash this is done with shopt -s dotglob.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
The easiest way is to tell your shell to include hidden files in globs. With bash this is done with shopt -s dotglob.
The easiest way is to tell your shell to include hidden files in globs. With bash this is done with shopt -s dotglob.
answered Feb 9 at 11:46
Ignacio Vazquez-Abrams
32.1k66780
32.1k66780
add a comment |Â
add a comment |Â
It's better if you don't create tarbombs.
â ams
Feb 9 at 11:46
2
How are you creating the zip file?
â Jeff Schaller
Feb 9 at 11:53