I am compressing list of files like this:
tar cvzf mycompress.tar.gz /dir1/dir2/file1.txt /dir1/dir2/file2.txt
However when I uncompressed them the directory
/dir1/dir2/ is still preserved.
How to exclude that?
This question came from our site for professional and enthusiast programmers.
You can do
That will leave out the path information in the archive.
If you want to encrypt only files and not directory (is this that you want to do? I'm not sure), then try to use find to exclude directories:
(Having files with the same name into different directories could be a problem)