现需打包test目录为tet.tar.gz,并排除test目录下的data1和data2目录:
tar test.tar.gz test/ --exclude=test/data1 --exclude=test/data2
注意:--exclude后面的排除目录后不能带/ ,否则不起作用。
现需打包test目录为tet.tar.gz,并排除test目录下的data1和data2目录:
tar test.tar.gz test/ --exclude=test/data1 --exclude=test/data2
注意:--exclude后面的排除目录后不能带/ ,否则不起作用。
转载于:https://my.oschina.net/u/3446722/blog/906441