'relative'에 해당되는 글 1건

  1. 2011.08.03 절대 경로를 상대 경로로 풀기
절대 경로로 tar된 파일을 상대 경로로 풀어야 할 경우가 있다.

이럴 경우 pax 명령어를 이용하면 손 쉽게 해결할 수 있다.
단, 모든 Unix에서 가능한 것은 아니다.

우선 tar 파일을 풀고자 하는 경로에 복사한다.

다음 명령어를 실행한다.

pax -r -s ',^/,,' -f file.tar

그러면 file.tar의 내용이 $CWD(현재 디렉토리)에 풀리게 된다.

>>>>>>>>>>>>>>> 원문 <<<<<<<<<<<<<<<<<<

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

                             UNIX GURU UNIVERSE
                                UNIX HOT TIP

                       Unix Tip 3462 - August  2, 2011

                   http://www.ugu.com/sui/ugu/show?tip.today

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


EXTRACT RELATIVE FROM ABSOLUTE

Ever had a tar archive which
was tarred up with an absolute
path, but you need to untar
it to a relative location?

There is an easy way to do
this using the "pax" command.
Note: Not available on all
flavors.

Firstly, copy the archive to
the relative location in
which you wish to untar it.

Then, execute the following
command:

pax -r -s ',^/,,' -f file.tar

The contents of file.tar will now
be in the $CWD.



--------------------------------------------------------------------------
To Subscribe:    http://www.ugu.com/sui/ugu/show?tip.subscribe
To Unsubscribe:  http://www.ugu.com/sui/ugu/show?tip.unsubscribe
To Submit A Tip: http://www.ugu.com/sui/ugu/show?tip.today

==========================================================================
DISCLAIMER: All UNIX HOT TIPS ARE OWNED BY THE UNIX GURU UNIVERSE AND ARE
NOT TO BE SOLD, PRINTED OR USED WITHOUT THE WRITTEN CONSENT OF THE UNIX
GURU UNIVERSE. ALL TIPS ARE "USE AT YOUR OWN RISK". UGU  ADVISES THAT
ALL TIPS BE TESTED IN A NON-PRODUCTION DEVELOPMENT ENVIRONMENT FIRST.

Unix Guru Universe - www.ugu.com - tips@ugu.com - Copyright 1994-2001
==========================================================================
반응형
Posted by She쥐포s
이전버튼 1 이전버튼

블로그 이미지
She쥐포s
Yesterday
Today
Total

달력

 « |  » 2024.3
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31

최근에 올라온 글

최근에 달린 댓글

글 보관함