Daily Archive for Marzo 12th, 2008

tar stdin/stdout

  • english
  • spanish

The tar command, like many other UNIX commands, can use stdin/stdout as its input/output target by using “-” instead of a real file.

What’s this useful for? For example, copying a full directory tree while keeping dates, ownerships and permissions, locally or remotely with ssh.


$ tar cf - . | ( cd /some/other/dir ; tar xfv - )
$ tar cf - dir | ssh usr@srv "tar xfv -"
  • Twitter
  • Facebook
  • Meneame
  • email
  • Print
  • PDF
  • RSS



Creative Commons Attribution-NonCommercial 2.5 Spain
This work is licensed under a Creative Commons Attribution-NonCommercial 2.5 Spain.