I have a following structure:
-folder1
-folder2
-file1
-file2
-folder3
-folder4
-folder5
-file3
-file4
使用bash我需要在實際目錄,其中將包含4個文件(文件1,文件2,文件3,文件4)創建.tar歸檔文件。我嘗試過的所有東西都使用它們的路徑來存檔文件。我需要的是檔案只是文件,其中必須包含:tar文件沒有路徑
file1
file2
file3
file4
您是否嘗試過--strip-components = n或--strip = n(在提取時使用),請參閱http://stackoverflow.com/questions/8043579/how-to-strip-path-while-archiving-與焦油? – user2672165
@ user2672165不,因爲我不需要提取它,只是爲了創建 – Vlad