tar all files and folders in the current directory


Recommended Posts

riahc3

Hello,

 

I want to make a tar file with everything inside the directory. This includes files, folders, and hidden "." files and folders.

 

Ive tried two commands

 

(lets say current directory Im in is /hello)

 

tar -zcvf something.tar.gz .

 

This does it but inside the archive, it adds a "." to the front of all files/folders

 

Next I tried:

tar -zcvf something.tar.gz *

This does it better but doesnt copy .htaccess and files that are hidden it seems

How can I do it?

Link to post
Share on other sites
snaphat (Myles Landwehr)

move outside of the current directory and then tar from there. It will get everything. The problem is that * doesn't complete for hidden files so you can't do it that way.

Link to post
Share on other sites
Haggis

move outside of the current directory 

tar -czf /tmp/workspace.tar.gz workspace

Assuming the directory you wanted to gzip was called workspace.

 

should work fine :)

Link to post
Share on other sites
Haggis

did this work?

Link to post
Share on other sites
riahc3

Hello,

 

I solved it using another method.

Link to post
Share on other sites
Haggis

might have been an idea to let us know

Link to post
Share on other sites
  • 1 year later...
simonlang

what distro do you use? there might be no need to use any complicated terminal commands. dolphin for example can do a zip/tar or whatever file and includes everything, also hidden files i just gave it a try. needs 2 mouse clicks and it's done.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.