Skip to main content
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
Source Link

Frederik DeweerdtFrederik Deweerdt has given a solution that works on GNU tar (used on Linux, Cygwin, FreeBSD, OSX, possibly others), but not on other systems such as NetBSD, OpenBSD or Solaris.

POSIX doesn't specify the tar command (because it varies too wildly between unix variants) and introduces the pax command instead. The option -w means to produce an archive (-r extracts), and -x selects the archive format. The option -s '!BRE!!' excludes all files whose path matches the basic regular expression BRE.

pax -w -x ustar -s '!^.*/\..*$!!' calendar_final >calendar_final.tar

Frederik Deweerdt has given a solution that works on GNU tar (used on Linux, Cygwin, FreeBSD, OSX, possibly others), but not on other systems such as NetBSD, OpenBSD or Solaris.

POSIX doesn't specify the tar command (because it varies too wildly between unix variants) and introduces the pax command instead. The option -w means to produce an archive (-r extracts), and -x selects the archive format. The option -s '!BRE!!' excludes all files whose path matches the basic regular expression BRE.

pax -w -x ustar -s '!^.*/\..*$!!' calendar_final >calendar_final.tar

Frederik Deweerdt has given a solution that works on GNU tar (used on Linux, Cygwin, FreeBSD, OSX, possibly others), but not on other systems such as NetBSD, OpenBSD or Solaris.

POSIX doesn't specify the tar command (because it varies too wildly between unix variants) and introduces the pax command instead. The option -w means to produce an archive (-r extracts), and -x selects the archive format. The option -s '!BRE!!' excludes all files whose path matches the basic regular expression BRE.

pax -w -x ustar -s '!^.*/\..*$!!' calendar_final >calendar_final.tar
hyperlink for pax
Source Link
Gilles 'SO- stop being evil'
  • 838.7k
  • 198
  • 1.8k
  • 2.2k

Frederik Deweerdt has given a solution that works on GNU tar (used on Linux, Cygwin, FreeBSD, OSX, possibly others), but not on other systems such as NetBSD, OpenBSD or Solaris.

POSIX doesn't specify the tar command (because it varies too wildly between unix variants) and introduces the paxpax command instead. The option -w means to produce an archive (-r extracts), and -x selects the archive format. The option -s '!BRE!!' excludes all files whose path matches the basic regular expression BRE.

pax -w -x ustar -s '!^.*/\..*$!!' calendar_final >calendar_final.tar

Frederik Deweerdt has given a solution that works on GNU tar (used on Linux, Cygwin, FreeBSD, OSX, possibly others), but not on other systems such as NetBSD, OpenBSD or Solaris.

POSIX doesn't specify the tar command (because it varies too wildly between unix variants) and introduces the pax command instead. The option -w means to produce an archive (-r extracts), and -x selects the archive format. The option -s '!BRE!!' excludes all files whose path matches the basic regular expression BRE.

pax -w -x ustar -s '!^.*/\..*$!!' calendar_final >calendar_final.tar

Frederik Deweerdt has given a solution that works on GNU tar (used on Linux, Cygwin, FreeBSD, OSX, possibly others), but not on other systems such as NetBSD, OpenBSD or Solaris.

POSIX doesn't specify the tar command (because it varies too wildly between unix variants) and introduces the pax command instead. The option -w means to produce an archive (-r extracts), and -x selects the archive format. The option -s '!BRE!!' excludes all files whose path matches the basic regular expression BRE.

pax -w -x ustar -s '!^.*/\..*$!!' calendar_final >calendar_final.tar
Source Link
Gilles 'SO- stop being evil'
  • 838.7k
  • 198
  • 1.8k
  • 2.2k

Frederik Deweerdt has given a solution that works on GNU tar (used on Linux, Cygwin, FreeBSD, OSX, possibly others), but not on other systems such as NetBSD, OpenBSD or Solaris.

POSIX doesn't specify the tar command (because it varies too wildly between unix variants) and introduces the pax command instead. The option -w means to produce an archive (-r extracts), and -x selects the archive format. The option -s '!BRE!!' excludes all files whose path matches the basic regular expression BRE.

pax -w -x ustar -s '!^.*/\..*$!!' calendar_final >calendar_final.tar