I am trying to compress a folder with the tar command.
When I am trying to compress it, it works fine. The problem is with the file name.
Source path:
/data/file/
Destination path:
/data/repo/temp/file.tar.gz
tar zcvf $srcpath $destinationpath
I am executing the command from a different folder, and while extracting the folder I am getting all the sub directories instead of file folder alone.
tar zcvf file.tar.gz /path/dir/to/compressmaybe you should change your command intar zcvf $destinationpath $srcpathbut it is unclear to me what you need. Could you elaborate your question with example of what you expect from tar command? – Lety Nov 24 '14 at 12:10