Skip to main content
Put maxdepth before type
Source Link
camh
  • 40.1k
  • 9
  • 77
  • 62

When you want to use find with tar, the best way is to use cpio instead of tar. cpio can write tar archives and is designed to take the list of files to archive from stdin.

find mydir -typemaxdepth f1 -maxdepthtype 1f -print0 | cpio -o -H ustar -0 > mydir.tar

Using find and cpio is a more unix-y approach in that you let find do the file selection with all the power that it has, and let cpio do the archiving. It is worth learning this simple use of cpio, as you find it easy to solve problems you bang your ahead against when trying tar.

When you want to use find with tar, the best way is to use cpio instead of tar. cpio can write tar archives and is designed to take the list of files to archive from stdin.

find mydir -type f -maxdepth 1 -print0 | cpio -o -H ustar -0 > mydir.tar

Using find and cpio is a more unix-y approach in that you let find do the file selection with all the power that it has, and let cpio do the archiving. It is worth learning this simple use of cpio, as you find it easy to solve problems you bang your ahead against when trying tar.

When you want to use find with tar, the best way is to use cpio instead of tar. cpio can write tar archives and is designed to take the list of files to archive from stdin.

find mydir -maxdepth 1 -type f -print0 | cpio -o -H ustar -0 > mydir.tar

Using find and cpio is a more unix-y approach in that you let find do the file selection with all the power that it has, and let cpio do the archiving. It is worth learning this simple use of cpio, as you find it easy to solve problems you bang your ahead against when trying tar.

Post Undeleted by camh
added 13 characters in body
Source Link
camh
  • 40.1k
  • 9
  • 77
  • 62

When you want to use find with tar, the best way is to use cpio instead of tar. cpio can write tar archives and is designed to take the list of files to archive from stdin.

find mydir -type f -maxdepth 1 -print0 | cpio -o -H ustar -0 > mydir.tar

Using find and cpio is a more unixyunix-y approach in that you let find do the file selection with all the power that it has, and let cpio do the archiving. It is worth learning this simple use of cpio, as you find it easy to solve problems you bang your ahead against when trying tar.

When you want to use find with tar, the best way is to use cpio instead of tar. cpio can write tar archives and is designed to take the list of files to archive from stdin.

find mydir -type f -print0 | cpio -o -H ustar -0 > mydir.tar

Using find and cpio is a more unixy approach in that you let find do the file selection with all the power that it has, and let cpio do the archiving. It is worth learning this simple use of cpio, as you find it easy to solve problems you bang your ahead against when trying tar.

When you want to use find with tar, the best way is to use cpio instead of tar. cpio can write tar archives and is designed to take the list of files to archive from stdin.

find mydir -type f -maxdepth 1 -print0 | cpio -o -H ustar -0 > mydir.tar

Using find and cpio is a more unix-y approach in that you let find do the file selection with all the power that it has, and let cpio do the archiving. It is worth learning this simple use of cpio, as you find it easy to solve problems you bang your ahead against when trying tar.

Post Deleted by camh
Source Link
camh
  • 40.1k
  • 9
  • 77
  • 62

When you want to use find with tar, the best way is to use cpio instead of tar. cpio can write tar archives and is designed to take the list of files to archive from stdin.

find mydir -type f -print0 | cpio -o -H ustar -0 > mydir.tar

Using find and cpio is a more unixy approach in that you let find do the file selection with all the power that it has, and let cpio do the archiving. It is worth learning this simple use of cpio, as you find it easy to solve problems you bang your ahead against when trying tar.