Here's a little, galactic-history lesson. When you finish it, you'll know both a new command and a portable way to copy directory hierarchies.
A long time ago, in a galaxy far, far away, there was a great struggle over which archiving tool the POSIX standard would choose: BSD's tar or AT&T's cpio. Who would rule the Empire? TAR2-D2 or 3Cpio? This mouse-and-frog battle was dubbed Tar Wars. (Cue John Williams' score.)
The winner was us. AT&T's Glenn Fowler, with Joerg Schilling, designed and implemented pax (Posix Archive eXchange), to supplant both. Pax would read and write either format, and is now on every POSIX-conforming system. Better still, on mine it's 30% smaller than tar, and less than a third the size of cpio.
Peace through unity.
A little-known-by-me feature of pax is that it will even copy directory hierarchies. Me, I use cp -a to do this job, but that's a GNU-specific idiom. Other versions of cp may lack the -a flag.
This portable command will copy olddir into newdir (newdir must exist), preserving ownerships and permissions:
$ sudo pax -pewr olddir newdir
Mnemonic: the copy is pure ("pewr").
3 comments:
just visit to your interesting blog.
thanks
免費視訊聊天室 - 免費視訊聊天室 - 小杜情色網 - 1007視訊 - 音樂試聽 - 試聽音樂 - 亞州視訊情色聊天室 - 情色視訊秀 - 視訊情色秀 - 情色部落格 - 色情聊天室 - 情色電話 - 免費視訊秀 - 色情視訊網 - 自拍電影免費下載 - 免即時通日本視訊 - 免即時通日本視訊 - 361色情成人電影下載 - 女學生自拍電影貼片區 - 線上色情電影 - 卡通色情貼圖 - 視訊交友視訊秀 - 日本美少女 - 大陸美少女 - 自拍台灣自拍 - 大陸自拍 - 美女掰穴 - 淫妹掰穴 - 視訊辣妹 - 視訊女主播 - 辣妹影音視訊 - 台灣辣妹自拍 -
$ man pax
No manual entry for pax
$ which pax
$
I feel so very non-special, but in POSIX sort of way.
I'll have to install it and give it a whirl. Seems quite simpler than my incantation of tar cf - . | (cd /path/destination; tar xf -)
I never did get into using cpio.
Post a Comment