Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8809179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:48:25+00:00 2026-06-14T02:48:25+00:00

I am running the following snippet in a bash script in a folder. This

  • 0

I am running the following snippet in a bash script in a folder. This creates an archive where there is no root folder since I am running the script within the folder whose contents I am archiving.

tar -pczf $ARCHIVE_NAME --exclude=${ARCHIVE_NAME} --exclude=$(basename ${0}) *

Archive Contents:
/a/
/b/
/c/
/a_normal_file

works great, but since I am using the * it is not archiving hidden files in the immediate directory. I did some searching and found archiving (ubuntu tar) hidden directories I have then changed it to:

tar -pczf $ARCHIVE_NAME --exclude=${ARCHIVE_NAME} --exclude=$(basename ${0}) .

Archive Contents:
/./a/
/./b/
/./c/
/./.a_hidden_file
/./a_normal_file

still works, but now there is a root folder being created with the name being the ‘.’ character. The contents are then within that. How do I get my previous result, but where it still archives hidden files in the immediate directory?

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:48:26+00:00Added an answer on June 14, 2026 at 2:48 am

    While it doesn’t affect the unpacking of the archive (since . just refers to the same dir), if it bothers you, you can change the wildcard from * to .[^.]* * to include all the hidden files as well.

    In addition, if you have hidden files beginning with .., such as ..a, you’ll need to add ..?* to the list as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Running the following line in my script gives me a Permission denied error: $config_out
Consider the following snippet running in an applet insdie a browser: WebServiceClient s =
Consider the following snippet: function fail { throw simulated failure } fail When running
I have the following snippet of PowerShell script in my profile: . (join-path (split-path
I am running the following snippet of code in the ipython notebook, using the
I am returning strings from a python module, for consumption within a bash script.
I'm running the following snippet of code (in ViewDidLoad method of a UITableViewController) to
I'm having problems running the following code snippet using JavaScript and JQuery. listOfDisplayCategories is
I am running following LINQ query in order to group by CategoryID var test
I am running following code to create bmp image from pdf using Ghost4j i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.