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

The name of the pictureThe name of the pictureThe name of the pictureClash 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.







share|improve this 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














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.







share|improve this 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












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.







share|improve this question












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.









share|improve this question











share|improve this question




share|improve this question










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
















  • 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










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.






share|improve this answer



























    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 .





    share|improve this answer




















    • 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

















    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.






    share|improve this answer



























      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.






      share|improve this answer
























        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.






        share|improve this answer






















          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.






          share|improve this answer












          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 9 at 13:24









          Philippos

          5,90211545




          5,90211545






















              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 .





              share|improve this answer




















              • 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














              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 .





              share|improve this answer




















              • 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












              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 .





              share|improve this answer












              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 .






              share|improve this answer












              share|improve this answer



              share|improve this answer










              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
















              • 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










              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.






              share|improve this answer
























                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.






                share|improve this answer






















                  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.






                  share|improve this answer












                  The easiest way is to tell your shell to include hidden files in globs. With bash this is done with shopt -s dotglob.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 9 at 11:46









                  Ignacio Vazquez-Abrams

                  32.1k66780




                  32.1k66780












                      Popular posts from this blog

                      Peggy Mitchell

                      Palaiologos

                      The Forum (Inglewood, California)