'널 카피'에 해당되는 글 1건

  1. 2008.09.21 null copy

2008. 9. 21. 17:47 Unix/Shell

null copy

○ null copy
        File의 Size를 0으로 만드는 작업으로 일반적으로 로그파일이 커졌을 때 해당 파일의 사이즈를 초기화하는 목적
        등으로 사용됨.

○ 방법
        1. cat /dev/null > FILENAME
                 /dev/null 파일을 직접 파일에 Redirection한다.
                일반적인 경우 사용됨.
                 예)
                    # cat /dev/null > /var/log/messages

        2. > FILENAME
                직접 Redirection해서 파일에 쓴다.
                Bourne Shell, Korn Shell에서 사용됨
                예)

                    # > /var/log/messages


참고 원문
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                             UNIX GURU UNIVERSE
                                UNIX HOT TIP

                       Unix Tip 3151 - September 21, 2008

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

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

NULL IT FAST

Here is the fastest way to truncate a file to zero
bytes in a bourne or korn shell.

$ > /var/log/messages

This is a good method, if the file has to be truncated,
but is opened by another process. For example, if you
want to truncate /var/log/messages, which is held
open by syslogd...

반응형
Posted by She쥐포s
이전버튼 1 이전버튼

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

달력

 « |  » 2024.4
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

최근에 올라온 글

최근에 달린 댓글

글 보관함