I have a folder with files which I want to zip into a tar.gz file. I am using the following command:
tar -czvf filename.tar.gz foldername
Sure enough this creates the file
filename.tar.gz. However, when I unzip the tar file, by default it creates a folder
filename and places all the files into the folder.
Can I avoid this folder creation when I create the tar file itself. I tried the following command but it doesn't work.
tar -czv filename.tar.gz foldername
I am using Ubuntu 14.04.
My current directory structure is as follows:
The directory foldername has all the files that I want to zip. My codes are as follows:
cd Test tar czvf filename.tar foldername/*