---
title: "copy file using tar"
author: "unixboy"
date: "2009-08-11T17:22:18Z"
tags: []
slug: "copy-file-using-tar"
draft: false
lastmod: "2009-08-11T17:22:18Z"
id: 444888
url: "https://unixboy.iteye.com/blog/444888"
---

```
We assume /source/dir is a filesystem, if there are other filesystems under /source/dir they
will also be copied to /destination/dir

cd /source/dir
tar -cf - . | ( cd /destination/dir ; tar -xpvf - )
```