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 -"












0 Responses to “tar stdin/stdout”
Leave a Reply