比如当前目录是/root下,打包/data/下的web1目录,到备份目录 /data/backup/下 则实现代码为: tar -czvf /data/backup/web1.tar.gz -C /data/ web1/ 请注意空格