달력

122024  이전 다음

  • 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

truss/tusc 옵션

OS 2009. 10. 28. 17:45

 -f 옵션은 truss 실행 시 fork 되는 child process 까지 truss를 수행함

예) truss/tusc –f tmboot –S svr1
       => tmboot 시 기동 되는 svr1 서버도 truss 를 수행 함

[ 사용 예 ]
 1. tmboot 시 tmax 엔진 내부 flow 이해 하는데 도움이 됨
 2. process를 boot 했는데 boot 가 안 될 경우 system call을 통해서
     어느 단계에서 에러가 발생했는지 원인 파악

-T : 시간 출력
-w : write 대상이며 원하는 fd를 list로 사용가능
-r  : read 대상이며 원하는 fd를 list로 사용가능
-b  : display 되는 data size
-E  : Show syscall entries. Tusc doesn't require OS notification for
                system call entry. It collects all the data it needs when the
                system call returns. This option will cause tusc to stop upon 
                syscall entry and produce a trace. This option is only useful
                for processes encountering invalid syscall errors as it will
                show the number of the invalid syscall.

 22:42:49 [2422] write(3, 0x600000000011a000, 40) ......... [entry]
 22:42:57 [2422] write(3, 0x600000000011a000, 40) ......... [running]

-s : 원하는 system call 만 truss
[ 사용 예 ]
tusc -T"%H:%M:%S" -w 5,3 -r 5,3 -b 100 –E -p 26301
tusc -w all -r all -b 1000 -s write,send,recv,read, -b 200 -E -p 12582

'OS' 카테고리의 다른 글

tar / gzip / jar / tbz 사용법  (0) 2009.10.14
split - 동일한 크기로 파일자르기  (0) 2009.09.22
[AIX] man netstat  (0) 2009.07.27
[dbx, truss, kdb, oslevel, lslpp] aix 5l 시스템 정보보기  (0) 2009.06.03
[명령어]Diff  (0) 2009.05.18
Posted by marryjane
|

tar / gzip / jar / tbz 사용법

OS 2009. 10. 14. 10:20

1. tar
  1) 파일을 묶을때 :
     -c tar 화일을 생성한다.
     -v 생성되는 화일 절차를 보여준다.
     -f backup 화일명을 지정 한다.
     -r tar 화일 끝에 파일을 추가한다. 
     tar -cvf 묶은파일명 묶일파일명
     tar -cvf 묶은파일명 *
 
     예)
       tar -cvf swingme.tar test.txt  <-  test.txt 파일을 swingme.tar 이라는 파일명으로 묶는다.
       tar -cvf swingme.tar test.txt exam.txt  <-  test.txt파일과 exam.txt 파일을 swingme.tar 파일로 묶는다. 
       tar -cvf swingme.tar *  <-  현재 디렉토리에 있는 파일 전부를 swingme.tar 파일로 묶는다.
       tar -rvf swingme.tar haha.txt  <-  swingme.tar 파일 끝에 haha.txt 파일을 추가하여 묶는다.
 
  2) 묶은 파일을 풀때 :
     tar -xvf 묶은파일.tar
 
     예)
       tar -xvf swingme.tar  <- swingme.tar로 묶인 파일은 푼다.
       tar -xvf swingme.tar test.txt  <-  swingme.tar로 묶인 파일에서 test.txt 파일만 추출한다.
 
2. gzip
  1) 압축할때 : 
     gzip -숫자 압축할 파일
     -1 : compress faster
     -9 : compress better
    
     예) gzip -1 swingme.tar  <-  swingme.tar 파일을 압축
  
  2) 압축풀때 :
     gzip -d 압축한파일
 
     예) gzip -d swingme.tar.gz  <-  swingme.tar.gz 압축파일을 푼다.
 
 
Tip : 묶으면서 압축하기
tar -zcvf swingme.tar.gz *  <- 모든파일을 swingme로 묶으면서 압축
 
3. jar
   tar 사용법과 같음

  1) 파일묶기

     jar cvf swingme.jar include  <- include 디렉토리를 swingme.jar 로 묶는다.

     jar cvf swingme.jar *.class *.java  <-  확장자가 .class 모든파일과 .java 모든파일을 swingme.jar 로 묶는다. 

     jar cvf swingme.jar include WEB-INF  <- include 디렉토리와 WEB-INF 디렉토리를 swingme.jar 로 묶는다.

  2) jar파일 풀기
     #jar xvf swingme.jar  <-  swingme.jar 파일을 풀음

 

4. tbz

   bzip2 로 압축된 tar 파일들의 확장자이다.

   FreeBSD 에서 패키지 파일로 압축을 풀지않고 바로 패키지를 설치할 수 있다.

   #pkg_add swingme.tbz <- swingme 라는 패키지 설치

   #pkg_delete swingme <- swingme 라는 패키지 삭제

   #pkg_info <- 설치된 패키지 확인

   #pkg_info -aR <- 설치된 패키지들의 상속관계확인

 

5. tgz

   tar 와 gzip 을 사용하여 tar 로 묶고 gzip 으로 압축한다.

   1) 압축 하기

    tar czvf filename.tgz file

   2) 압축 풀기

    rat -xzvf filename.tgz


'OS' 카테고리의 다른 글

truss/tusc 옵션  (0) 2009.10.28
split - 동일한 크기로 파일자르기  (0) 2009.09.22
[AIX] man netstat  (0) 2009.07.27
[dbx, truss, kdb, oslevel, lslpp] aix 5l 시스템 정보보기  (0) 2009.06.03
[명령어]Diff  (0) 2009.05.18
Posted by marryjane
|

사용법: split [-l 행_수] [-a 접미어_길이] [파일 [접두어]]
  또는: split -b 숫자[k|m] [-a 접미어_길이] [파일 [접두어]]

Flags

            Note: The -b and -l flags are mutually exclusive.

       -a SuffixLength
            Specifies the number of letters to use in forming the suffix portion of the output name files. The number of letters
            determines the number of possible output filename combinations. The default is two letters.
       -b Number
            Splits the file into the number of bytes specified by the Number variable. Adding the k (kilobyte) or m (megabyte)
            multipliers to the end of the Number value causes the file to be split into Number*1024 or Number*1,048,576 byte
            pieces, respectively.
       -l LineCount
            Specifies the number of lines in each output file. The default is 1000 lines.

Examples

       1    To split a file into 1000-line segments, enter:

            split book

            This example splits book into 1000-line segments named xaa, xab, xac, and so forth.
       2    To split a file into 50-line segments and specify the file-name prefix, enter:

            split -l 50 book sect

            This example splits book into 50-line segments named sectaa, sectab, sectac, and so forth.
       3    To split a file into 2KB segments, enter:

            split -b 2k book

            This example splits the book into 2*1024-byte segments named xaa, xab, xac, and so forth.
       4    To split a file into more than 676 segments, enter:

            split -l 5 -a 3 book sect

            This example splits a book into 5-line segments named sectaaa, sectaab, sectaac, and so forth, up to sectzzz (a
            maximum of 17,576 files).

'OS' 카테고리의 다른 글

truss/tusc 옵션  (0) 2009.10.28
tar / gzip / jar / tbz 사용법  (0) 2009.10.14
[AIX] man netstat  (0) 2009.07.27
[dbx, truss, kdb, oslevel, lslpp] aix 5l 시스템 정보보기  (0) 2009.06.03
[명령어]Diff  (0) 2009.05.18
Posted by marryjane
|

[AIX] man netstat

OS 2009. 7. 27. 13:21

Flags

       -A
            Shows the address of any protocol control blocks associated with the sockets. This flag acts with the default
            display and is used for debugging purposes.
       -a
            Shows the state of all sockets. Without this flag, sockets used by server processes are not shown.
       -c
            Shows the statistics of the Network Buffer Cache.

            The Network Buffer Cache is a list of network buffers that contain data objects that can be transmitted to
            networks. The Network Buffer Cache grows dynamically as data objects are added to or removed from it. The Network
            Buffer Cache is used by some network kernel interfaces for performance enhancement on the network I/O. The netstat
            -c command prints the following statistic:

            Network Buffer Cache Statistics:
            Current total cache buffer size: 0
            Maximum total cache buffer size: 0
            Current total cache data size: 0
            Maximum total cache data size: 0
            Current number of cache: 0
            Maximum number of cache: 0
            Number of cache with data: 0
            Number of searches in cache: 0
            Number of cache hit: 0
            Number of cache miss: 0
            Number of cache newly added: 0
            Number of cache updated: 0
            Number of cache removed: 0
            Number of successful cache accesses: 0
            Number of unsuccessful cache accesses: 0
            Number of cache validation: 0
            Current total cache data size in private segments: 0
            Maximum total cache data size in private segments: 0
            Current total number of private segments: 0
            Maximum total number of private segments: 0
            Current number of free private segments: 0
            Current total NBC_NAMED_FILE entries: 0
            Maximum total NBC_NAMED_FILE entries: 0
       -C
            Shows the routing tables, including the user-configured and current costs of each route. The user-configured cost
            is set using the -hopcount flag of the route command. The current cost may be different than the user-configured
            cost if Dead Gateway Detection has changed the cost of the route.

            In addition to the costs of the route, it also shows the weight and policy information associated with each route.
            These fields are applicable only when the Multipath Routing Feature is used. The policy information displays the
            routing policy that has been currently selected to choose between the multiple routes available. The policies
            available are:
              *    Default - Weighted Round Robin (WRR)
              *    Hashed (HSH)
              *    Random (RND)
              *    Weighted Random (WRND)
              *    Lowest Utilization (LUT)
            The weight field is a user-configured weight associated with the route that will be used for Weighted Round-Robin
            and Weighted Random Policies. For more information about these policies, see the no command.
       -D
            Shows the number of packets received, transmitted, and dropped in the communications subsystem. Note: In the
            statistics output, a N/A displayed in a field value indicates the count is not applicable. For the NFS/RPC
            statistics, the number of incoming packets that pass through RPC are the same packets that pass through NFS, so
            these numbers are not summed in the NFS/RPC Total field, thus the N/A. NFS has no outgoing packet or outgoing
            packet drop counters specific to NFS and RPC. Therefore, individual counts have a field value of N/A, and the
            cumulative count is stored in the NFS/RPC Total field.
       -f AddressFamily
            Limits reports of statistics or address control blocks to those items specified by the AddressFamily variable. The
            following address families are recognized:
              inet
                   Indicates the AF_INET address family.
              inet6
                   Indicates the AF_INET6 address family.
              unix
                   Indicates the AF_UNIX address family.
       -g
            Shows Virtual Interface Table and Multicast Forwarding Cache information. If used in conjunction with the -s flag,
            it will show the multicast routing information.

       -i
            Shows the state of all configured interfaces. See "Interface Display." Note: The collision count for Ethernet
            interfaces is not supported.
       -I Interface
            Shows the state of the configured interface specified by the Interface variable.
       -M
            Shows network memory's mbuf cluster pool statistics.
       -m
            Shows statistics recorded by the memory management routines.
       -n
            Shows network addresses as numbers. When this flag is not specified, the netstat command interprets addresses where
            possible and displays them symbolically. This flag can be used with any of the display formats.
       -o
            Used in conjunction with the -a flag to display detailed data about a socket, such as socket options, flags, and
            buffer statistics.
       -p Protocol
            Shows statistics about the value specified for the Protocol variable, which is either a well-known name for a
            protocol or an alias for it. Some protocol names and aliases are listed in the /etc/protocols file. A null response
            means that there are no numbers to report. The program report of the value specified for the Protocol variable is
            unknown if there is no statistics routine for it.
       -P
            Shows the statistics of the Data Link Provider Interface (DLPI). The netstat -P command prints the following
            statistic:

            DLPI statistics:
            Number of received packets = 0
            Number of transmitted packets = 0
            Number of received bytes = 0
            Number of transmitted bytes = 0
            Number of incoming pkts discard = 0
            Number of outgoing pkts discard = 0
            Number of times no buffers = 0
            Number of successful binds = 0
            Number of unknown message types = 0
            Status of phys level promisc = 0
            Status of sap level promisc = 0
            Status of multi level promisc = 0
            Number of enab_multi addresses = 0

            If DLPI is not loaded, it displays:

            can't find symbol: dl_stats
       -r
            Shows the routing tables. When used with the -s flag, the -r flag shows routing statistics. See "Routing Table
            Display."
       -s
            Shows statistics for each protocol.
       -ss
            Displays all the non-zero protocol statistics and provides a concise display.
       -u
            Displays information about domain sockets.
       -v
            Shows statistics for CDLI-based communications adapters. This flag causes the netstat command to run the statistics
            commands for the entstat, tokstat, and fddistat commands. No flags are issued to these device driver commands. See
            the specific device driver statistics command to obtain descriptions of the statistical output.
       -Zc
            Clear network buffer cache statistics.
       -Zi

            Clear interface statistics.
       -Zm
            Clear network memory allocator statistics.
       -Zs
            Clear protocol statistics. To clear statistics for a specific protocol, use -p <protocol>. For example, to clear
            TCP statistics, type netstat -Zs -p tcp.

Examples
       1    To display routing table information for an Internet interface, type:

            netstat -r -f inet

            This produces the following output:

            Routing tables
            Destination   Gateway      Flags Refs Use  PMTU If  Exp Groups Netmasks:
            (root node)
            (0)0 ffff f000 0
            (0)0 ffff f000 0
            (0)0 8123 262f 0 0 0 0 0
            (root node)
            Route Tree for Protocol Family 2:
            (root node)
            default        129.35.38.47   UG    0  564   -   tr0   -
            loopback       127.0.0.1      UH    1  202   -   lo0   -
            129.35.32      129.35.41.172  U     4   30   -   tr0   -   +staff
            129.35.32.117  129.35.41.172  UGHW  0   13  1492 tr0   30
            192.100.61     192.100.61.11  U     1  195   -   en0   -
            (root node)
            Route Tree for Protocol Family 6:
            (root node)
            (root node)

            The -r -f inet flags indicate a request for routing table information for all configured Internet interfaces. The
            network interfaces are listed in the Interface column; en designates a Standard Ethernet interface, while tr
            specifies a Token-Ring interface. Gateway addresses are in dotted decimal format. Note: AIX 5.3 does not display
            the PMTU column.
       2    To display statistics for GRE Protocol, type:

            netstat -s -p gre

            This produces the following output:

            GRE Interface gre0
                    10 number of times gre_input got called
                    8 number of times gre_output got called
                    0 packets received with protocol not supported
                    0 packets received with checksum on
                    0 packets received with routing present
                    0 packets received with key present
                    0 packets received with sequence number present
                    0 packets received with strict source route  present
                    0 packets received with recursion control present
                    0 packets received where reserved0 non-zero
                    0 packets received where version non-zero
                    0 packets discarded
                    0 packets dropped due to network down
                    0 packets dropped due to protocol not supported
                    0 packets dropped due to error in ip output routine
                    0 packets got by NAT
                    0 packets got by NAT but not TCP packet
                    0 packets got by NAT but with IP options

       3    To display interface information for an Internet interface, type:

            netstat -i -f inet

            This produces the following output if you are using AIX 4.2:

            Name Mtu   Network     Address   Ipkts  Ierrs  Opkts  Oerrs  Coll
            lo0  1536  <Link>                    4      0      4      0     0
            lo0  1536  127         loopback      4      0      4      0     0
            en0  1500  <Link>                   96      0     67      0     0
            en0  1500  192.100.61  nullarbor    96      0     67      0     0
            tr0  1500  <Link>                44802      0  11134      0     0
            tr0  1500  129.35.32   stnullarb 44802      0  11134      0     0

            This produces the following output if you are using AIX 4.3:

            Name Mtu    Network     Address           Ipkts  Ierrs  Opkts  Oerrs  Coll
            lo0  16896  Link#1                        5161      0    5193      0     0
            lo0  16896  127         localhost         5161      0    5193      0     0
            lo0  16896  ::1                           5161      0    5193      0     0
            en1  1500   Link#2      8.0.38.22.8.34    221240    0  100284      0     0
            en1  1500   129.183.64  infoserv.frec.bul 221240    0  100284      0     0

            The -i -f inet flags indicate a request for the status of all configured Internet interfaces. The network
            interfaces are listed in the Name column; lo designates a loopback interface, en designates a Standard Ethernet
            interface, while tr specifies a Token-Ring interface.
       4    To display statistics for each protocol, type:

            netstat -s -f inet

            This produces the following output:

            ip:
            :
              44485 total packets received
              0 bad header checksums
              0 with size smaller than minimum
              0 with data size < data length
              0 with header length < data size
              0 with data length < header length
              0 with bad options
              0 with incorrect version number
              0 fragments received
              0 fragments dropped (dup or out of space)
              0 fragments dropped after timeout
              0 packets reassembled ok
              44485 packets for this host
              0 packets for unknown/unsupported protocol
              0 packets forwarded
              0 packets not forwardable
              0 redirects sent
              1506 packets sent from this host
              0 packets sent with fabricated ip header
              0 output packets dropped due to no bufs, etc.
              0 output packets discarded due to no route
              0 output datagrams fragmented
              0 fragments created
              0 datagrams that can't be fragmented
              0 IP Multicast packets dropped due to no receiver

              0 successful path MTU discovery cycles
              0 path MTU rediscovery cycles attempted
              0 path MTU discovery no-response estimates
              0 path MTU discovery response timeouts
              0 path MTU discovery decreases detected
              0 path MTU discovery packets sent
              0 path MTU discovery memory allocation failures
              0 ipintrq overflows
            icmp:
              0 calls to icmp_error
              0 errors not generated 'cuz old message was icmp
              Output histogram:
                echo reply: 6
              0 messages with bad code fields
              0 messages < minimum length
              0 bad checksums
              0 messages with bad length
              Input histogram:
                echo: 19
              6 message responses generated
            igmp:defect
              0 messages received
              0 messages received with too few bytes
              0 messages received with bad checksum
              0 membership queries received
              0 membership queries received with invalid field(s)
              0 membership reports received
              0 membership reports received with invalid field(s)
              0 membership reports received for groups to which we belong
              0 membership reports sent
            tcp:
              1393 packets sent
                857 data packets (135315 bytes)
                0 data packets (0 bytes) retransmitted
                367 URG only packets
                0 URG only packets
                0 window probe packets
                0 window update packets
                170 control packets
              1580 packets received
                790 acks (for 135491 bytes)
                60 duplicate acks
                0 acks for unsent data
                638 packets (2064 bytes) received in-sequence
                0 completely duplicate packets (0 bytes)
                0 packets with some dup. data (0 bytes duped)
                117 out-of-order packets (0 bytes)
                0 packets (0 bytes) of data after window
                0 window probes
                60 window update packets
                0 packets received after close
                0 discarded for bad checksums
                0 discarded for bad header offset fields
              0 connection request
              58 connection requests
              61 connection accepts
              118 connections established (including accepts)
              121 connections closed (including 0 drops)
              0 embryonic connections dropped

              845 segments updated rtt (of 847 attempts)
              0 resends due to path MTU discovery
              0 path MTU discovery terminations due to retransmits
              0 retransmit timeouts
                0 connections dropped by rexmit timeout
              0 persist timeouts
              0 keepalive timeouts
                0 keepalive probes sent
                0 connections dropped by keepalive
            udp:
              42886 datagrams received
            :
              0 incomplete headers
              0 bad data length fields
              0 bad checksums
              0 dropped due to no socket
              42860 broadcast/multicast datagrams dropped due to no
            socket
              0 socket buffer overflows
              26 delivered
              106 datagrams output

            ip specifies the Internet Protocol; icmp specifies the Information Control Message Protocol; tcp specifies the
            Transmission Control Protocol; udp specifies the User Datagram Protocol. Note: AIX 5.3 does not display the PMTU
            statistics for the IP protocol.
       5    To display device driver statistics, type:

            netstat -v

            The netstat -v command displays the statistics for each CDLI-based device driver that is up. To see sample output
            for this command, see the tokstat command, the entstat command, or the fddistat command.
       6    To display information regarding an interface for which multicast is enabled, and to see group membership, type:

            netstat -a -I interface

            For example, if an 802.3 interface was specified, the following output will be produced:

            Name  Mtu  Network Address      Ipkts  Ierrs  Opkts  Oerrs  Coll
            et0   1492 <Link>                   0      0      2      0     0
            et0   1492 9.4.37  hun-eth          0      0      2      0     0
                               224.0.0.1
                               02:60:8c:0a:02:e7
                               01:00:5e:00:00:01

            If instead of -I interface the flag -i is given, then all configured interfaces will be listed. The network
            interfaces are listed in the Name column; lo designates a loopback interface, et designates an IEEE 802.3
            interface, tr designates a Token-Ring interface, while fi specifies an FDDI interface.

            The address column has the following meaning. A symbolic name for each interface is shown. Below this symbolic
            name, the group addresses of any multicast groups that have been joined on that interface are shown. Group address
            224.0.0.1 is the special all-hosts-group to which all multicast interfaces belong. The MAC address of the interface
            (in colon notation) follows the group addresses, plus a list of any other MAC level addresses that are enabled on
            behalf of IP Multicast for the particular interface.
       7    To display the packet counts in the communication subsystem, type:

            netstat -D

            The following output will be produced:

            Source                    Ipkts     Opkts     Idrops      Odrops
            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            tok_dev0                   720       542       0          0
            ent_dev0                   114         4       0          0
                               - - - - - - - - - - - - - - - - - - - - - - - - -
            Devices Total              834       546       0          0
            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            tok_dd0                    720       542       0          0
            ent_dd0                    114         4       0          0
                               - - - - - - - - - - - - - - - - - - - - - - - - -
            Drivers Total              834       546       0          0
            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            tok_dmx0                   720       N/A       0          N/A
            ent_dmx0                   114       N/A       0          N/A
                               - - - - - - - - - - - - - - - - - - - - - - - - -
            Demuxer Total              834       N/A       0          N/A
            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            IP                         773       767       0          0
            TCP                        536       399       0          0
            UDP                        229        93       0          0
                               - - - - - - - - - - - - - - - - - - - - - - - - -
            Protocols Total           1538      1259       0          0
            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            lo_if0                      69        69       0          0
            en_if0                      22         8       0          0
            tr_if0                     704       543       0          1
                               - - - - - - - - - - - - - - - - - - - - - - - - -
            Net IF Total               795       620       0          1
            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            NFS/RPC Client             519       N/A       0          N/A
            NFS/RPC Server               0       N/A       0          N/A
            NFS Client                 519       N/A       0          N/A
            NFS Server                  0       N/A       0          N/A
                               - - - - - - - - - - - - - - - - - - - - - - - - -
            NFS/RPC Total              N/A       519       0          0
            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            (Note:  N/A -> Not Applicable)
       8    To display detailed data of active sockets, type:

            netstat -aon
            Output similar to the following is displayed:

            Active Internet connections (including servers)
            Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)
            tcp4       0      0  *.13                   *.*                    LISTEN
                  so_options: (ACCEPTCONN|REUSEADDR)
                  q0len:0 qlen:0 qlimit:1000      so_state: (PRIV)
                  timeo:0 uid:0
                  so_special: (LOCKBALE|MEMCOMPRESS|DISABLE)
                  so_special2: (PROC)
                  sndbuf:
                         hiwat:16384 lowat:4096 mbcnt:0 mbmax:65536
                  rcvbuf:
                         hiwat:16384 lowat:1 mbcnt:0 mbmax:65536
                         sb_flags: (SEL)
                  TCP:
                         mss:512
            tcp        0      0  *.21                   *.*                    LISTEN
                  so_options: (ACCEPTCONN|REUSEADDR)

                  q0len:0 qlen:0 qlimit:1000      so_state: (PRIV)
                  timeo:0 uid:0
                  so_special: (LOCKBALE|MEMCOMPRESS|DISABLE)
                  so_special2: (PROC)
                  sndbuf:
                         hiwat:16384 lowat:4096 mbcnt:0 mbmax:65536
                  rcvbuf:
                         hiwat:16384 lowat:1 mbcnt:0 mbmax:65536
                         sb_flags: (SEL)
                  TCP:
                  mss:512
            ...................
            ...................
       9    To display the routing table, type the following:

            netstat -rn
            Output similar to the following is displayed:

            Routing tables
            Destination      Gateway           Flags   Refs     Use  If   PMTU Exp Groups
            Route Tree for Protocol Family 2 (Internet):
            default          9.3.149.65        UG        0       24  en0     -   -
            9.3.149.64       9.3.149.88        UHSb      0        0  en0     -   -         =>
            9.3.149.64/27    9.3.149.88        U         1        0  en0     -   -
            9.3.149.88       127.0.0.1         UGHS      0        1  lo0     -   -
            9.3.149.95       9.3.149.88        UHSb      0        0  en0     -   -
            127/8            127.0.0.1         U        11      174  lo0     -   -
            Route Tree for Protocol Family 24 (Internet v6):
            ::1              ::1               UH        0        0  lo0     -   -
            Note: AIX 5.3 does not display the PMTU column.

            The character => at the end of the line means the line is a duplicate route of the route on the next line.

            The loopback route (9.3.149.88, 127.0.0.1) and the broadcast routes (with the flags field containing b indicating
            broadcast) are automatically created when an interface is configured. Two broadcast routes are added: one to the
            subnet address and one to the broadcast address of the subnet. The presence of the loopback routes and broadcast
            routes improve performance.

'OS' 카테고리의 다른 글

tar / gzip / jar / tbz 사용법  (0) 2009.10.14
split - 동일한 크기로 파일자르기  (0) 2009.09.22
[dbx, truss, kdb, oslevel, lslpp] aix 5l 시스템 정보보기  (0) 2009.06.03
[명령어]Diff  (0) 2009.05.18
expr - 숫자계산  (0) 2009.04.08
Posted by marryjane
|

1. 현재 프로세스 상태 조회
 => 문제가 되는 프로세스의 정보 조회
kars2141:/kaprod> ps -ef | grep hth
  eworks 655576 729320   0  10:15:35  pts/1  0:00 grep hth
  eworks 802880      1   0  6월 12일      -  0:00 hth -I jeuservice_565484 -b 565484

 => 해당 계정이 실행한 프로세스의 정보조회
kars2141:/kaprod> ps -ef | grep eworks
  eworks 639160 499778   0  10:15:28  pts/2  0:00 -ksh
  eworks 655578 729320   1  10:15:43  pts/1  0:00 ps -ef
  eworks 688174 729320   1  10:15:43  pts/1  0:00 grep eworks
  eworks 729320 811046   0  10:15:18  pts/1  0:00 -ksh
  eworks 802880      1   0  6월 12일      -  0:00 hth -I jeuservice_565484 -b 565484
 

2. truss 를 통한 프로세스 상태 조회
 => aix5L에 truss명령어가 생겼더군요... 
    -p 옵션에 pid를 주면 됩니다. :)
    truss -e -f -o truss_test.txt -p 745480
         ---- -- ---------------   --------
        환경변수, fork, outputfile,   pid

kars2141:/kaprod> truss -p 802880
truss: 0915-023 Cannot control process #802880
kars2141:/kaprod>
        <- 일단 현재상황에서는 truss를 통해 프로세스를 제어하지 못함

 
3. dbx를 통한 프로세스 상태 조회
 => dbx를 통해 동일하게 상태를 조회할 수 있습니다.
    -a의 값으로 pid를 주고 다음값으로 문제의 프로세스의 파일의 절대경로를 지정해줌

kars2141:/kaprod> dbx -a 802880 /kaprod/jeus33/WebtoB/bin/hth
Waiting to attach to process 802880 ...
^C
kars2141:/kaprod>
        <- dbx로도 프로세스에 접근할 수 없는 상황임


4. 해당 프로세스를 강제로 종료해봅니다.
 => 해당 계정의 권한 뿐만 아니라 root의 권한으로 동일하게 실행해봄

kars2141:/kaprod> kill -SEGV 802880
kars2141:/kaprod> ps -ef | grep hth
  eworks 802880      1   0   Jun 12      -  0:00 hth -I jeuservice_565484 -b 565484
    root 852110 606268   1 10:57:16  pts/3  0:00 grep hth
kars2141:/kaprod> kill -9 802880
kars2141:/kaprod> ps -ef | grep hth
  eworks 802880      1   0   Jun 12      -  0:00 hth -I jeuservice_565484 -b 565484
    root 852112 606268   0 10:57:38  pts/3  0:00 grep hth
kars2141:/kaprod>
        <- 역시 종료가 않되는 상태


5. kdb를 통한 시스템상태 조회
  => 데이타량이 많으므로 미리 script명령을 실행해서 로그를 남김.
     kdb실행전에 문제의 프로세스의 pid를 확인해둠

kars2141:/kaprod> script wlog.txt
Script command is started. The file is wlog.txt.
kars2141:/kaprod>
 
 
  => kdb를 실행

kars2141:/kaprod> kdb
The specified kernel file is a 64-bit kernel
Preserving 945581 bytes of symbol table
First symbol __mulh
           START              END <name>
0000000000003500 0000000002403068 _system_configuration+000020
F00000002FF3A600 F00000002FFCF8C8 __ublock+000000
000000002FF22FF4 000000002FF22FF8 environ+000000
000000002FF22FF8 000000002FF22FFC errno+000000
F100008780000000 F100008790000000 pvproc+000000
F100008790000000 F100008794000000 pvthread+000000
F100000040000000 F10000004028D4E8 vmmdseg+000000
F1000013B0000000 F1000083B5400000 vmmswpft+000000
F100000BB0000000 F1000013B0000000 vmmswhat+000000
F100000050000000 F100000060000000 ptaseg+000000
F100000070000000 F1000000B0000000 ameseg+000000
F100009E10000000 F100009E20000000 KERN_heap+000000
F1000089C0000000 F1000089D0000000 MBUF_heap+000000
F100009C00000000 F100009C10000000 lkwseg+000000
PFT:
PVT:
id....................0008
raddr.....00000000013BC000 eaddr.....0000000000000000
size..............00400000 align.............00001000
valid..1 ros....0 holes..0 io.....0 seg....1 wimg...2
(0)>

      
       <-- 일단의 정보가 보여지고 프로프트가 (0)> 의 형태로 변경됨

 

6. conv명령을 이용하여 문제프로세스의 pid를 변환(pid값과 변환된 pid값을 메모해둠)
(0)> conv 802880
Binary : 0000000000000000000000000000000000000000000011000100000001000000
Octal  : 0000000000000003040100
Decimal: 802880
Hex    : 00000000000C4040
(0)>

 

7. tpid 명령을 이용하여 해당 프로세스의 슬롯값을 조회합니다.(슬롯값을 메모해둠)
(0)> tpid 00000000000C4040
                SLOT NAME     STATE    TID PRI  RQ CPUID  CL WCHAN

pvthread+028E80 1309 hth      SLEEP A3A053 03C   0        65 KERN_heap+538A160 slist_table+000010
(0)>

        <-- 여기서는 1309 입니다.

 

8. set명령을 통해 kdb의 상태를 확인하고 다시 scroll 속성값을 false로 줍니다.
   => set명령의 인자로 No값을 주면 토글형태로 속성값이 변경됨

(0)> set 
 No toggle name               current value

  1 no_symbol                 false
  2 mst_wanted                true
  3 screen_size               24
  4 power_pc_syntax           true
  5 origin                    00000000
  6 Unix symbols start from 3500
  7 hexadecimal_wanted        true
  8 screen_previous           false
  9 display_stack_frames      false
 10 display_stacked_regs      false
 11 64_bit                    true
 12 ldr_segs_wanted           false
 18 trace_back_lookup         false
 20 scroll                    true
 21 edit                     
 22 logfile                  
 23 loglevel                  2
(0)> set 20
scroll is false
(0)>

 

9. stat명령과 status 명령으로 시스템정보를 조회합니다.
(0)> stat
SYSTEM_CONFIGURATION:
CHRP_SMP_PCI POWER_PC POWER_4 machine with 2 cpu(s)  (64-bit registers)

SYSTEM STATUS:
sysname... AIX
nodename.. kars2141
release... 1
version... 5
machine... 003830DA4C00
nid....... 3830DA4C
age of system: 5 day, 16 hr., 33 min., 45 sec.
xmalloc debug: disabled
(0)> status
CPU     TID  TSLOT     PID  PSLOT  PROC_NAME
  0 16B205D   2905   BA060     93  kdb_64
  1    6007      3    6006      3  wait
(0)>

 


10. proc명령으로 해당 프로세스의 상태를 조회합니다.(proc에서 나온 pid값과 슬롯값 역시 메모)
  => proc * 이란 명령을 사용하여 모든 프로세스의 상태를 조회한 후
     문제의 프로세스의 상태를 확인합니다.

(0)> proc *
              SLOT NAME     STATE      PID    PPID          ADSPACE  CL #THS

pvproc+000000    0 swapper  ACTIVE 0000000 0000000 0000000020B70000   0 0001
pvproc+000400    1 init     ACTIVE 0000001 0000000 0000000024B92000  65 0001
pvproc+000800    2 wait     ACTIVE 0004004 0000000 0000000024B72000   0 0001
pvproc+000C00    3 wait     ACTIVE 0006006 0000000 0000000028B74000   0 0001
pvproc+001000    4 reaper   ACTIVE 0008008 0000000 000000002CB76000  65 0001
pvproc+001400    5 lrud     ACTIVE 000A00A 0000000 0000000030B78000  65 0001
pvproc+001800    6 xmgc     ACTIVE 000C00C 0000000 0000000012B89000  65 0001
pvproc+001C00    7 netm     ACTIVE 000E00E 0000000 0000000016B8B000  65 0001
pvproc+002000    8 gil      ACTIVE 0010010 0000000 000000001AB8D000  65 0005
pvproc+002400    9 wlmsched ACTIVE 0012012 0000000 0000000020B90000  65 0001
pvproc+003000   12 syncd    ACTIVE 0018044 0000001 0000000004C62400  65 0001
pvproc+003400   13 errdemon ACTIVE 001A060 0000001 0000000022C71400  65 0001
pvproc+003800   14 srcmstr  ACTIVE 001C078 0000001 0000000038C7C400  65 0001
pvproc+003C00   15 j2pg     ACTIVE 001E024 0000000 000000002CBF6000  65 000A
pvproc+004400   17 sendmail ACTIVE 0022062 001C078 0000000026CB3400  65 0001
pvproc+004800   18 dog      ACTIVE 0024030 0000000 000000002AC35000  65 0002
pvproc+005000   20 IBM.CSMA ACTIVE 0028088 001C078 000000002EDD7400  65 000D
pvproc+005400   21 jfsz     ACTIVE 002A078 0000000 0000000016C8B000  65 0001
pvproc+005800   22 lvmbb    ACTIVE 002C03C 0000000 0000000010BE8000  65 0001
pvproc+006000   24 syslogd  ACTIVE 0030068 001C078 000000000ACA5400  65 0001
pvproc+006400   25 portmap  ACTIVE 0032038 001C078 0000000034CBA400  65 0001
pvproc+006800   26 shlap64  ACTIVE 0034052 0000001 0000000020C70400  65 0001
pvproc+006C00   27 inetd    ACTIVE 0036036 001C078 0000000024CB2400  65 0001
pvproc+007000   28 xntpd    ACTIVE 0038038 001C078 0000000032CB9400  65 0001
pvproc+007400   29 snmpd64  ACTIVE 003A03A 001C078 0000000012CC9400  65 0001
pvproc+007800   30 dpid2    ACTIVE 003C03C 001C078 0000000038CDC400  65 0001
pvproc+007C00   31 hostmibd ACTIVE 003E03E 001C078 000000000ACE5400  65 0001
pvproc+008000   32 rtcmd    ACTIVE 0040042 0000000 0000000014CEA000  65 0001
pvproc+008400   33 kbiod    ACTIVE 0042042 0000000 000000001CCEE000  65 0002
pvproc+009000   36 rpc.stat ACTIVE 0048050 001C078 0000000000D00400  65 0003
pvproc+009400   37 biod     ACTIVE 004A04C 001C078 0000000010CE8400  65 0001
pvproc+009800   38 rpc.lock ACTIVE 004C050 001C078 000000000CD06400  65 0001
pvproc+009C00   39 rpc.lock ACTIVE 004E04E 0000001 0000000016D0B000  65 000A
pvproc+00A000   40 cron     ACTIVE 0050050 0000001 000000002ECF7400  65 0001
pvproc+00A400   41 uprintfd ACTIVE 0052058 0000001 000000001AD0D400  65 0001
pvproc+00A800   42 writesrv ACTIVE 005405A 001C078 000000002ED17400  65 0001
pvproc+00AC00   43 qdaemon  ACTIVE 0056058 001C078 0000000024D12400  65 0001
pvproc+00BC00   47 httpdlit ACTIVE 005E060 0000001 000000001AD2D400  65 0001
pvproc+00C400   49 diagd    ACTIVE 0062064 0000001 0000000010D28400  65 0001
pvproc+00CC00   51 ksh      ACTIVE 006606A 0000001 0000000036D3B400  65 0001
pvproc+00D000   52 rmcd     ACTIVE 0068088 001C078 000000003CD7E400  65 0003
pvproc+00D400   53 itesmdem ACTIVE 006A06E 0000001 0000000004D62400  65 0001
pvproc+00D800   54 ctcasd   ACTIVE 006C08E 001C078 0000000014D2A400  65 0007
pvproc+00DC00   55 IBM.Serv ACTIVE 006E09A 001C078 000000002CE16400  65 0007
pvproc+00EC00   59 dtlogin  ACTIVE 0076088 001C078 0000000024D92400  65 0001
pvproc+00F800   62 sadc     ACTIVE 007C0FC 00D006C 000000002AEB5400  65 0001
pvproc+00FC00   63 java     ACTIVE 007E0F0 0000001 000000003B7BD400  65 008B
pvproc+010000   64 IBM.ERrm ACTIVE 008008A 001C078 0000000010E68400  65 0008
pvproc+010400   65 IBM.Audi ACTIVE 0082082 001C078 000000002AE15400  65 000A
pvproc+010C00   67 java     ACTIVE 0086042 0000001 000000001B7AD400  65 008B
pvproc+011C00   71 sso_engi ACTIVE 008E090 0000001 0000000026A32400  65 0011
pvproc+012800   74 ksh      ACTIVE 009403C 00CA036 000000000D047400  65 0001
pvproc+013C00   79 java     ACTIVE 009E024 0000001 000000003B73D400  65 005B
pvproc+014000   80 script   ACTIVE 00A002E 00A8082 000000000AB04400  65 0001
pvproc+015000   84 ksh      ACTIVE 00A8082 00B20EA 000000003D03F400  65 0001
pvproc+016400   89 ksh      ACTIVE 00B20EA 00C6028 0000000010AC9400  65 0001
pvproc+017400   93*kdb_64   ACTIVE 00BA060 009403C 0000000032AD8400  65 0001
pvproc+018800   98 hth      ACTIVE 00C4040 0000001 00000000057A2400  65 0001
pvproc+018C00   99 telnetd  ACTIVE 00C6028 0036036 0000000005702400  65 0001
pvproc+019400  101 script   ACTIVE 00CA036 00A002E 0000000005043400  65 0001
pvproc+01A000  104 bsh      ACTIVE 00D006C 0000001 0000000007042400  65 0001
pvproc+002800   10          NONE   0014016 0000001 0000000000000000  65 0000
pvproc+002C00   11          NONE   0016062 0000001 0000000000000000  65 0000
pvproc+004000   16          NONE   00200B4 00AA02E 0000000000000000  65 0000
pvproc+004C00   19          NONE   0026034 0000001 0000000000000000  65 0000
pvproc+005C00   23          NONE   002E052 0000001 0000000000000000  65 0000
pvproc+008800   34          NONE   0044028 0000001 0000000000000000  65 0000
pvproc+008C00   35          NONE   0046016 0000001 0000000000000000  65 0000
pvproc+00B000   44          NONE   0058060 0000001 0000000000000000  65 0000
pvproc+00B400   45          NONE   005A060 0000001 0000000000000000  65 0000
pvproc+00B800   46          NONE   005C0D2 00B20C0 0000000000000000  65 0000
pvproc+00C000   48          NONE   0060060 0000001 0000000000000000  65 0000
pvproc+00C800   50          NONE   0064000 00D203A 0000000000000000  65 0000
pvproc+00E000   56          NONE   00700C8 00AA02E 0000000000000000  65 0000
pvproc+00E400   57          NONE   0072034 00AA02E 0000000000000000  65 0000
pvproc+00E800   58          NONE   00740FE 0000001 0000000000000000  65 0000
pvproc+00F000   60 <zombie> ZOMB   00780B2 0076088 000000FFFFFFF000  65 0001
pvproc+00F400   61          NONE   007A042 0036036 0000000000000000  65 0000
pvproc+010800   66          NONE   008403A 00AA02E 0000000000000000  65 0000
pvproc+011000   68          NONE   00880B4 00AA02E 0000000000000000  65 0000
pvproc+011400   69          NONE   008A0EC 005C0D2 0000000000000000  65 0000
pvproc+011800   70          NONE   008C0B2 00880AA 0000000000000000  65 0000
pvproc+012000   72 <zombie> ZOMB   0090094 0076088 000000FFFFFFF000  65 0001
pvproc+012400   73          NONE   00920FA 00AA02E 0000000000000000  65 0000
pvproc+012C00   75          NONE   009606E 00AA02E 0000000000000000  65 0000
pvproc+013000   76          NONE   00980F0 0000001 0000000000000000  65 0000
pvproc+013400   77          NONE   009A05C 0000001 0000000000000000  65 0000
pvproc+013800   78          NONE   009C0B8 007A042 0000000000000000  65 0000
pvproc+014400   81          NONE   00A2062 0000001 0000000000000000  65 0000
pvproc+014800   82          NONE   00A4076 0000001 0000000000000000  65 0000
pvproc+014C00   83          NONE   00A600E 0000001 0000000000000000  65 0000
pvproc+015400   85          NONE   00AA08A 00A6008 0000000000000000  65 0000
pvproc+015800   86          NONE   00AC02E 00C2074 0000000000000000  65 0000
pvproc+015C00   87          NONE   00AE080 0000001 0000000000000000  65 0000
pvproc+016000   88          NONE   00B0030 0000001 0000000000000000  65 0000
pvproc+016800   90          NONE   00B400A 005C0D2 0000000000000000  65 0000
pvproc+016C00   91          NONE   00B602E 0000001 0000000000000000  65 0000
pvproc+017000   92          NONE   00B8036 00C2074 0000000000000000  65 0000
pvproc+017800   94          NONE   00BC05E 0000001 0000000000000000  65 0000
pvproc+017C00   95          NONE   00BE0A0 0000001 0000000000000000  65 0000
pvproc+018000   96          NONE   00C0094 0000001 0000000000000000  65 0000
pvproc+018400   97          NONE   00C20E2 0000001 0000000000000000  65 0000
pvproc+019000  100          NONE   00C8046 00A40D2 0000000000000000  65 0000
pvproc+019800  102          NONE   00CC070 00640EE 0000000000000000  65 0000
pvproc+019C00  103          NONE   00CE020 0000001 0000000000000000  65 0000
pvproc+01A400  105          NONE   00D203A 0050050 0000000000000000  65 0000
pvproc+01A800  106          NONE   00D40F6 00D80DC 0000000000000000  65 0000
pvproc+01AC00  107          NONE   00D60EA 0000001 0000000000000000  65 0000
pvproc+01B000  108          NONE   00D80EC 00C60F0 0000000000000000  65 0000
(0)>

     <-- 문제가 된 hth프로세스는
   pvproc+018800   98 hth      ACTIVE 00C4040 0000001 00000000057A2400  65 0001
         처럼 active상태로 정상처럼 보임
  

 

11. proc명령으로 문제 프로세스만의 상태를 조회(메모해둔 slot값을 인자로 사용)
(0)> proc 98
              SLOT NAME     STATE      PID    PPID          ADSPACE  CL #THS

pvproc+018800   98 hth      ACTIVE 00C4040 0000001 00000000057A2400  65 0001

NAME....... hth
STATE...... stat  :07  .... xstat :0000
FLAGS...... flag  :00200001 LOAD EXECED
........... flag2 :00000000
........... atomic :00040000 ORPHANPGRP
LINKS...... child      :0000000000000000
........... siblings   :F10000878000CC00 <pvproc+00CC00>
........... uidinfo    :F100009E2C3CF640
........... ganchor    :0000000000000000
THREAD..... threadlist :F100008790028E80 <pvthread+028E80>
DISPATCH... synch      :FFFFFFFFFFFFFFFF
WLM........ class/wlm  :41/0000
IDENTIFIER. uid        :000000C9  ........... suid       :000000C9
........... pid        :000C4040  ........... ppid       :00000001
........... sid        :0005C0D2  ........... pgrp       :0008A0EC
MISC...... lock       @ F100008780018930 0000000000000000
.......... lock_d     @ F1000087800189E8 0000000000000000
..... parent_lock     @ F1000087800189E0 0000000000000000
..... session_lock    @ F1000087800189D8 0000000000000000
........... pgrpl      :0000000000000000
........... pgrpb      :0000000000000000  ... ttyl       :0000000000000000
........... ipc        :0000000000000000
........... dblist     :0000000000000000  ... dbnext     :0000000000000000
STATISTICS. nframes    :0000000000000016  ... npsblks    :0000000000000000
........... nvpages    :0000000000000016  ... auditmask  :00000000
SCHEDULER.. sched_next :0000000000000000  ... sched_back :0000000000000000
........... mempools  @ F100008780018A00 8000000000000000
......... usched_lock @ F100008780018950 0000000000000000
........... uschedp    :0000000000000000
........... asyncio    :0000000000000000
CHECKPOINT. crid       :00000000  ........... crid_token :FFFFFFFF
........... cridnext   :0000000000000000  ... chksynch   :FFFFFFFF
........... vpid       :00000000  ........... vppid      :00000000
........... vsid       :00000000  ........... vpgrp      :00000000
PROCFS..... procfsvn   :0000000000000000
NUMA....... rset       :0000000000000000
PROC....... procp      :F100009E2C75D400  ... size       :000001C0

FLAGS...... flag  :00000000
........... flag2 :00000000
........... int   :00000000
........... atomic:00000000
THREAD..... threadcount:00000001  ........... active     :00000001
........... suspended  :00000000  ........... terminating:00000000
........... local      :00000000
SCHEDULE... nice       :      60  ........... sched_pri  :     255
DISPATCH... pevent     :0000000000000000
IDENTIFIER. pid        :000C4040
MISC....... adspace    :00000000057A2400
........... adtable    :FFFFFFFFFFFFFFFF  ... adspace_ldr:000000FFFFFFF000
SIGNAL..... infoq      :0000000000000000
........... pending    :[3] 0000000000000000
........................[2] 0000000000000000
........................[1] 0000000000000000
........................[0] 0000000000000110 TRAP KILL
........... sigignore  :[3] 0000000000000000
........................[2] 0000000000000000
........................[1] 0000000000000000
........................[0] 0400000000000000 CPUFAIL
........... sigcatch   :[3] 0000000000000000
........................[2] 0000000000000000
........................[1] 0000000000000000
........................[0] 00000000F9FEF63F HUP INT QUIT ILL TRAP ABRT BUS
........................ SEGV PIPE ALRM TERM URG TSTP CONT
........................ CHLD TTIN TTOU IO XCPU XFSZ WINCH
........................ PWR USR1 USR2 PROF
........... siginfo    :[3] 0000000000000000
........................[2] 0000000000000000
........................[1] 0000000000000000
........................[0] 0000000000000000
STATISTICS. page size  :00000000000004AB  ... minflt     :0000000000000483
........... majflt     :0000000000000000  ... pctcpu     :00000000
SCHEDULER.. repage     :0000000000000000  ... sched_count:00000000
........... cpticks    :0000....  ........... msgcnt     :0000
........... majfltsec  :00000000
........... rs_attinfo :0000000000000000  ........... sradassign :0000
........... rs_rss     :0000000000000476  ........... boundcount :0000
CHECKPOINT. chkblock   :00000000  ........... chkfile    :0000000000000000
PROCFS..... prtrcset   :F100009E2C462500
PVPROC..... pvprocp    :F100008780018800  ... size       :00000400
(0)>

 


12. th명령으로 쓰레드상태를 조회(tpid에서 나온 슬롯값을 인자로 사용)
(0)> th 1309
                SLOT NAME     STATE    TID PRI  RQ CPUID  CL WCHAN

pvthread+028E80 1309 hth      SLEEP A3A053 03C   0        65 KERN_heap+538A160 slist_table+000010

NAME................ hth
WTYPE............... WLOCK   
.................tid :0000000000A3A053  ......tsleep :FFFFFFFFFFFFFFFF
...............flags :00000000  ..............flags2 :00000000
DATA.........pvprocp :F100008780018800 <pvproc+018800>
LINKS.....prevthread :F100008790028E80 <pvthread+028E80>
..........nextthread :F100008790028E80 <pvthread+028E80>
DISPATCH.......synch :FFFFFFFFFFFFFFFF
SCHEDULER...affinity :00000000  .................pri :0000003C
.............boosted :00000000  ...............wchan :0000000000000000
...............state :00000003  ...............wtype :00000002
CHECKPOINT......vtid :00000000  .............chkfile :0000000000000000
LOCK........ lock_d @ F100008790028E90 0000000000000000
PROCFS......procfsvn :0000000000000000
THREAD.......threadp :F100009E2C3CDC00  ........size :00000080

FLAGS............... SUSP SIGAVAIL PROCFS SIGSLIH SIGINTR
.................tid :0000000000A3A053  ......stackp :000000002FF22470
.................scp :0000000000000000  .......ulock :0000000000000000
...............uchan :0000000000000000  ....userdata :0000000000000000
..................cv :0000000000000000  .......flags :0000000000000086
..............atomic :0000000000000000  ......flags2 :0000000000000000
DATA...........procp :F100009E2C75D400 <F100009E2C75D400>
...........pvthreadp :F100008790028E80 <pvthread+028E80>
...............userp :F00000002FF3B000 <__ublock+000A00>
............uthreadp :F00000002FF3A600 <__ublock+000000>
SLEEP/LOCK......usid :0000000000000000  ......wchan1 :F100009E1538A160
..............wchan2 :0000000000000000  ......swchan :000000000023C3C0
...........eventlist :0000000000000000  ......result :00000001
.............polevel :000014BB  ..............pevent :0000000000000000
..............wevent :0000000000000000  .......slist :F100009E2C77AA00
...........wchan1sid :000000000003C9DE  wchan1offset :0538A160
...........lockcount :00000001  ..........adsp_flags :0000
DISPATCH.......ticks :00000000  ...............prior :F100009E2C786C00
................next :F100009E2C55B600  ......dispct :00000000000004D0
...............fpuct :0000000000000000
MISC........graphics :0000000000000000  ...pmcontext :0000000000000000
...........lockowner :0000000000000000  ..kthreadseg :000000FFFFFFF000
..........time_start :0000000000000000  ..........wlm_charge :0
SIGNAL........sigproc:00000000  ..............cursig :00000000
......(pending) sig  :[3] 0000000000000000
......................[2] 0000000000000000
......................[1] 0000000000000000
......................[0] 0000000000000000
............sigmask  :[3] 0000000000000000
......................[2] 0000000000000000
......................[1] 0000000000000000
......................[0] 0000000000000000
SCHEDULER......cpuid :FFFFFFFF  ..............scpuid :FFFFFFFF
.........affinity_ts :00ECB862  ..............policy :00000000
.................cpu :00000000  .............lockpri :0000003C
.............wakepri :000000FF  ................time :000000FF
.............sav_pri :0000003C  ...........run_queue :F100009E1404E000
................cpu2 :0000003A
.............suspend :00000001  .............fsflags :00000000
..........norun_secs :00000000
CHECKPOINT..chkerror :0000      ............chkblock :00000000
PROCFS.......whystop :00000001  ............whatstop :00000000
............pri_band :00  ........allowed_cpus :C000000000000000
.......prefunnel_cpu :00000000
......threadcontrolp :0000000000000000
PVTHREAD...pvthreadp :F100008790028E80  ........size :00000080
(0)>

 

13. f명령을 이용하여 스택정보를 조회(인자로 역시 tpid명령의 슬롯값을 사용)
(0)> f 1309
pvthread+028E80 STACK:
[00337370]slock+0003D8 (0000000000009910, 80000000000090B2 [??])
[00009558].simple_lock+000058 ()
[00110734]uipc_usrreq+0001F0 (??, ??, ??, ??, ??)
[00121200]soclose2+0005F8 (??, ??)
[00126D44]soclose+000010 (??)
[00126BEC]soo_close+0000C8 (??)
[004AE068]closef+000078 (??)
[004530A0]closefd+0000A0 (??, ??)
[00453334]close+000230 (??)
[0000379C]sc_msr_2_point+000028 ()
(0)>

 

14. set명령을 이용해서 display_stack_frames, display_stacked_regs,
   trace_back_lookup 속성을 true로 변경
(0)> set
 No toggle name               current value

  1 no_symbol                 false
  2 mst_wanted                true
  3 screen_size               24
  4 power_pc_syntax           true
  5 origin                    00000000
  6 Unix symbols start from 3500
  7 hexadecimal_wanted        true
  8 screen_previous           false
  9 display_stack_frames      false
 10 display_stacked_regs      false
 11 64_bit                    true
 12 ldr_segs_wanted           false
 18 trace_back_lookup         false
 20 scroll                    false
 21 edit                     
 22 logfile                  
 23 loglevel                  2
(0)> set 9
display_stack_frames is true
(0)> set 10
display_stacked_regs is true
(0)> set 18
trace_back_lookup is true
(0)> set
 No toggle name               current value

  1 no_symbol                 false
  2 mst_wanted                true
  3 screen_size               24
  4 power_pc_syntax           true
  5 origin                    00000000
  6 Unix symbols start from 3500
  7 hexadecimal_wanted        true
  8 screen_previous           false
  9 display_stack_frames      true
 10 display_stacked_regs      true
 11 64_bit                    true
 12 ldr_segs_wanted           false
 18 trace_back_lookup         true
 20 scroll                    false
 21 edit                     
 22 logfile                  
 23 loglevel                  2
(0)>

 

15. 다시 f명령을 사용해서 스택정보를 조회합니다.
(0)> f 1309
pvthread+028E80 STACK:
[00337370]slock+0003D8 (0000000000009910, 80000000000090B2 [??])
   r31 : 0000000000000000 r30 : F1000089C09C6D00 r29 : 0000000000000000
   r28 : 0000000000000000 r27 : F1000089C0902C00 r26 : 0000000000000000
   r25 : F1000089C0902C00 r24 : 0000000000000000 r23 : 0000000000000000
   r22 : F100009D00011FF0 r21 : 0000000020015AC0 r20 : 00000000200155E0
   r19 : 0000000000000000 r18 : 0000000000000000 r17 : 000000000000000C
   r16 : 0000000000000008 r15 : 0000000000000000 r14 : 0000000000000010
=======================================================================
F00000002FF3A080: F000 0000  2FF3 A0F0  0000 0000  0000 0000   ..../...........
F00000002FF3A090: 0000 0000  0000 955C  0000 0000  0000 000C   .......\........
F00000002FF3A0A0: 0000 0000  0000 0000  0000 0000  0059 9000   .............Y..
F00000002FF3A0B0: 0000 0000  2001 55E0  0000 0000  2001 5AC0   .... .U..... .Z.
=======================================================================
[00009558].simple_lock+000058 ()
=======================================================================
F00000002FF3A0F0: F000 0000  2FF3 A1B0  F100 0089  C028 F240   ..../........(.@
F00000002FF3A100: 0000 0000  0011 0738  F100 0089  C00A 5800   .......8......X.
F00000002FF3A110: F000 0000  2FF3 A1B0  2022 0124  C00A 5800   ..../... ".$..X.
F00000002FF3A120: 0000 0000  000E F54C  0000 0000  0000 0001   .......L........
=======================================================================
[00110734]uipc_usrreq+0001F0 (??, ??, ??, ??, ??)
   r31 : F1000089C0902C00 r30 : 00000000000034C8 r29 : 0000000000000001
   r28 : 0000000000000000 r27 : 0000000000000000 r26 : F1000089C028F240
   r25 : 0000000000000000 r24 : 0000000000000000 r23 : 800000102520002C
=======================================================================
F00000002FF3A1B0: F000 0000  2FF3 A290  8442 2120  2C40 4240   ..../....B! ,@B@
F00000002FF3A1C0: 0000 0000  0012 1204  0000 0000  0000 0000   ................
F00000002FF3A1D0: 0000 0000  0000 0010  0000 0000  0059 9000   .............Y..
F00000002FF3A1E0: 0000 0000  0000 0008  0000 0000  0000 000C   ................
=======================================================================
[00121200]soclose2+0005F8 (??, ??)
   r31 : F100009D00011FF0 r30 : 0000000000000000 r29 : 0000000000000000
   r28 : 00000000000034C8 r27 : F100009D00011FF0 r26 : F1000089C0902C00
   r25 : 0000000000000060 r24 : 0000000000000006 r23 : 0000000000000000
=======================================================================
F00000002FF3A290: F000 0000  2FF3 A300  2422 2224  2FF3 A600   ..../...$""$/...
F00000002FF3A2A0: 0000 0000  0012 6D48  0000 0000  0000 0000   ......mH........
F00000002FF3A2B0: 0000 0000  0000 0008  0000 0000  0000 000C   ................
F00000002FF3A2C0: 0000 0000  0000 0000  0000 0000  0000 0000   ................
=======================================================================
[00126D44]soclose+000010 (??)
=======================================================================
F00000002FF3A300: F000 0000  2FF3 A3A0  F100 009D  0001 E020   ..../..........
F00000002FF3A310: 0000 0000  0012 6BF0  0000 0000  0000 0000   ......k.........
F00000002FF3A320: 0000 0000  0000 0001  F100 009D  0001 E020   ...............
F00000002FF3A330: F000 0000  2FF3 A3A0  0000 0000  0000 0001   ..../...........
=======================================================================
[00126BEC]soo_close+0000C8 (??)
   r31 : F100009D00011FF0 r30 : 0000000000000000 r29 : 0000000000000000
   r28 : F00000002FF3A660 r27 : F100009D00011FF0 r26 : 0000000000000006
=======================================================================
F00000002FF3A3A0: F000 0000  2FF3 A430  F000 0000  2FF3 A490   ..../..0..../...
F00000002FF3A3B0: 0000 0000  004A E06C  0000 0000  0000 0005   .....J.l........
F00000002FF3A3C0: 0000 0010  0000 0000  0000 0000  0059 9000   .............Y..
F00000002FF3A3D0: 0000 0000  0000 0000  0000 0000  0000 0000   ................
=======================================================================
[004AE068]closef+000078 (??)
   r31 : F00000002FF3A600 r30 : 0000000000000001 r29 : 0000000000000000
=======================================================================
F00000002FF3A430: F000 0000  2FF3 A4D0  0000 0000  0000 0004   ..../...........
F00000002FF3A440: 0000 0000  0045 30A4  2FF2 2618  0000 0001   .....E0./.&.....
F00000002FF3A450: 0000 0000  0053 629C  0000 0000  0059 9000   .....Sb......Y..
F00000002FF3A460: F000 0000  2FF3 A410  0000 0000  0000 0000   ..../...........
=======================================================================
[004530A0]closefd+0000A0 (??, ??)
   r31 : 0000000000000000 r30 : 0000000000000006 r29 : 0000000000000006
   r28 : 0000000000000000 r27 : F00000002FF3A600 r26 : 0000000000000000
=======================================================================
F00000002FF3A4D0: F000 0000  2FF3 A590  2222 2224  0000 0005   ..../..."""$....
F00000002FF3A4E0: 0000 0000  0045 3338  0000 0000  0000 0028   .....E38.......(
F00000002FF3A4F0: 0000 0000  0000 0000  0000 0000  0059 9000   .............Y..
F00000002FF3A500: 0000 0000  2FF2 2FF8  0000 0000  0000 0000   ...././.........
=======================================================================
[00453334]close+000230 (??)
   r31 : 0000000000000000 r30 : 000000001000F30C r29 : 0000000000000007
   r28 : 0000000020014B28 r27 : 0000000020015600 r26 : 000000000000016C
   r25 : 0000000020000460 r24 : 0000000020015608 r23 : 0000000000000000
   r22 : 0000000020015630
=======================================================================
F00000002FF3A590: 0000 0000  0000 0000  2222 2224  0000 0000   ........"""$....
F00000002FF3A5A0: 0000 0000  0000 37A0  0000 0000  0000 0000   ......7.........
F00000002FF3A5B0: 0000 0000  0000 0000  0000 0000  0000 0000   ................
F00000002FF3A5C0: 0000 0000  2FF2 2420  0000 0000  2000 49B8   ..../.$ .... .I.
=======================================================================
[0000379C]sc_msr_2_point+000028 ()
=======================================================================
2FF22470: 2FF2 25D0  0000 0000  1000 F230  0000 0004   /.%........0....
2FF22480: 0000 07E0  2000 A068  2045 6420  F008 D720   .... ..h Ed ...
2FF22490: 2FF2 2570  F008 6E00  0000 0000  0000 0000   /.%p..n.........
2FF224A0: 0000 0000  F008 6E00  3231 3431  0043 3030   ......n.2141.C00
=======================================================================
(0)>


16. kdb상태에서 netstat 정보를 조회합니다.
(0)> netstat
Active Internet connections
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)
tcp4       0      0  172.80.177.102.37974   172.80.177.101.9900    ESTABLISHED
tcp4       0      0  172.80.177.102.37975   172.80.177.101.9900    ESTABLISHED
tcp4       0      0  172.80.177.102.37976   172.80.177.101.9900    ESTABLISHED
tcp4       0      0  172.80.177.102.37977   172.80.177.101.9900    ESTABLISHED
tcp4       0      0  172.80.177.102.37979   172.80.177.101.9900    ESTABLISHED
  .
  .
  .
F1000089C0A5C000 stream      0      0                0                0                0                0
F1000089C0227000
(0)>


17. ipc정보 조회
(0)> ipc  
  <-- 먼저 ipc라고 실행후
IPC info
Select the display:
 1) Message Queues
 2) Shared Memory
 3) Semaphores
  <-- SharedMemory문제이므로 2번
Enter your choice: 2
 1) all shmid_ds
 2) select shmid_ds
  <-- 모든 sharedmemory 를 조회
Enter your choice: 1
In kdb_pr_shmid_ds_all, shm_mark = 14
Shared memory ID 00000000 @ F10000AF50000000
uid............. 00000000 gid............. 00000000
cuid............ 00000000 cgid............ 00000000
mode............ 000081B6 seq............. 0000
key............. 000000000D01A845
  .
  .
  .
vhat_next....... 0000000000000000
vhat_prev....... 0000000000000000
(0)>

 

18. sock명령으로 소켓정보를 조회합니다.
(0)> sock
---- TCP ----(inpcb: @ F1000089C027FA50)----
---- SOCKET INFO ----(@ F1000089C027F800)----
    type........ 0001 (STREAM)
    opts........ 0006 (ACCEPTCONN|REUSEADDR)
    linger...... 0000 state....... 0080 (PRIV)
    pcb..... F1000089C027FA50 proto... 062A63B8 lock.... F1000089C014EA40 head.... 00000000
    q0...... 00000000 q....... 00000000 dq...... 00000000 q0len....... 0000
    qlen........ 0000 qlimit...... 03E8 dqlen....... 0000 timeo....... 0000
    error....... 0000 special..... 0A08 pgid.... 00000000 oobmark. 00000000
snd:cc...... 00000000 hiwat... 00004000 mbcnt... 00000000 mbmax... 00010000
    lowat... 00001000 mb...... 00000000 sel..... 00000000 events...... 0000
    iodone.. 00000000 ioargs.. 00000000 lastpkt. 00000000 wakeone. FFFFFFFF
    timer... 00000000 timeo... 00000000 flags....... 0000 ()
    wakeup.. 00000000 wakearg. 00000000 lock.... FFFFFFFFF1000089
rcv:cc...... 00000000 hiwat... 00004000 mbcnt... 00000000 mbmax... 00010000
    lowat... 00000001 mb...... 00000000 sel..... 00000000 events...... 0001
    iodone.. 00000000 ioargs.. 00000000 lastpkt. 00000000 wakeone. FFFFFFFF
    timer... 00000000 timeo... 00000000 flags....... 0008 (SEL)
    wakeup.. 00000000 wakearg. 00000000 lock.... FFFFFFFFF1000089
    tpcb.... 00000000 fdev_ch. F100009E2C3CF680 sec_info 00000000 qos..... 00000000
    gidlist. 00000000 private. 00000000 uid..... 00000000 bufsize. 00000000
    threadcnt00000000 nextfree 00000000 siguid.. 00000000 sigeuid. 00000000
    sigpriv. 00000000
    sndtime. 00000000 sec 00000000 usec rcvtime. 00000000 sec 00000000 usec
proc/fd:  27/12
---- TCP ----(inpcb: @ F1000089C0283250)----
---- SOCKET INFO ----(@ F1000089C0283000)----
    type........ 0001 (STREAM)
  .
  .
  .
    threadcnt00000000 nextfree 00000000 siguid.. 00000000 sigeuid. 00000000
    sigpriv. 00000000
    sndtime. 0000000A sec 00000000 usec rcvtime. 00000000 sec 00000000 usec
proc/fd:
(0)>
(0)>
(0)>


19. u명령으로 user thread를 조회합니다.
(0)> u
User thread context [F00000002FF3A600]:
   save.... @ F00000002FF3A600   fpr..... @ F00000002FF3A808
Uthread System call state:
   msr........800000000000D0B2
   errnopp....0FFFFFFFFFFFFFE8   error......00000000
   context...0000000000000000
   sigssz....0000000000000000
   stkb......0000000000000000
   scsave[0]..BADC0FFEE0DDF00D   scsave[1]..0000000000000008
   scsave[2]..0000000000000004   scsave[3]..0900000000035894
   scsave[4]..FFFFFFFFFFFFFFFF   scsave[5]..00000000F0080CCC
   scsave[6]..FFFFFFFFFFFFFFFF   scsave[7]..0000000000000003
   flags: ASSERTSIG CHKWAKE
   kstack.....F00000002FF3A600   audsvc.....0000000000000000
  .
  .
  .
SNODE... @ F00000002FF3B928
     origin...F000000020000000
     freeind..FFFFFFFF     nextind..00000002
     maxind...00071646     size.....00000120
UNODE... @ F00000002FF3B948
     origin...F000000027F91000
     freeind..FFFFFFFF     nextind..00000011
     maxind...000D6D93     size.....00000098
(0)>

 


20. oslevel명령과 lslpp명령으로  oslevel과 명령어 버전을 확인
 => oslevel -r 과 -g명령으로 oslevel상태를 체크함
kars1141:/kaprod> oslevel -r
5100-03

kars1141:/kaprod> oslevel -g
Fileset                                 Actual Level        Maintenance Level
-----------------------------------------------------------------------------
IMNSearch.bld.DBCS                      2.3.1.15            2.3.1.0
IMNSearch.bld.SBCS                      2.3.1.15            2.3.1.0
IMNSearch.rte.com                       2.3.1.15            2.3.1.0
   .
   .
   .
xlsmp.msg.en_US.rte                     1.3.6.0             1.3.4.0
xlsmp.rte                               1.3.6.0             1.3.4.0
kars1141:/kaprod>


 => lslpp 명령으로 실행가능한 명령어의 버전을 확인함
kars1141:/kaprod> lslpp -Lc
#Package Name:Fileset:Level:State:PTF Id:Fix State:Type:Description:Destination Dir.:Uninstaller:Message Catalog:Message Set:Message Number:Parent
IMNSearch.bld:IMNSearch.bld.DBCS:2.3.1.15: : :C: :NetQuestion DBCS Buildtime Modules : : : : : : :
IMNSearch.bld:IMNSearch.bld.SBCS:2.3.1.15: : :C: :NetQuestion SBCS Buildtime Modules : : : : : : :
   .
   .
   .
cdrecord:cdrecord-1.9-4:1.9: : :C:R:A command line CD/DVD recording program.: :/bin/rpm -e cdrecord: : : : :
mkisofs:mkisofs-1.13-4:1.13: : :C:R:Creates an image of an ISO9660 filesystem.: :/bin/rpm -e mkisofs: : : : :
mtools:mtools-3.9.8-1:3.9.8: : :C:R:Programs for accessing MS-DOS disks without mounting the disks.: :/bin/rpm -e mtools: : : : :
kars1141:/kaprod>

 


21. q명령으로 kdb를 종료하고, exit명령으로 script모드를 종료합니다.
(0)> q
kars2141:/kaprod> ps -ef | grep hth
  eworks 802880      1   0   Jun 12      -  0:00 hth -I jeuservice_565484 -b 565484
    root 852098 606268   0 10:54:46  pts/3  0:00 grep hth
kars2141:/kaprod>
kars2141:/kaprod> exit
Script command is complete. The file is wlog.txt.
kars2141:/kaprod> ls -alrt wlog.txt

   <- 해당 로그파일이 제대로 생성되었는지 확인

'OS' 카테고리의 다른 글

split - 동일한 크기로 파일자르기  (0) 2009.09.22
[AIX] man netstat  (0) 2009.07.27
[명령어]Diff  (0) 2009.05.18
expr - 숫자계산  (0) 2009.04.08
유닉스 쉘 간단한 팁  (0) 2009.04.08
Posted by marryjane
|

[명령어]Diff

OS 2009. 5. 18. 14:11

파일 내용 비교
-b : 끝 공백, 탭 무시
-i : 대소문자 무시
-w : 모든 공백 탭 무시

man page
       -b
            Causes any amount of white space at the end of a line to be treated as a single newline character (the white-
            space characters preceding the newline character are ignored) and other strings of white-space characters, not
            including newline characters, to compare equally.
       -C Lines
            Produces a diff command comparison with a number of lines of context equal to the value specified by the Lines
            variable. The -C flag modifies the output slightly. The output begins with identification of the files involved
            and their creation dates. Each change is separated by a line with a dozen * (asterisks). The lines removed from
            File1 are marked with a - (minus sign ) and those added to File2 are marked with a + (plus sign). Lines changed
            from one file to the other are marked in both files with an ! (exclamation point). Changes that lie within the
            specified context lines of each other are grouped together as output.
       -c
            Produces a diff command comparison with three lines of context. The -c flag modifies the output slightly. The
            output begins with identification of the files involved and their creation dates. Each change is separated by a
            line with a dozen * (asterisks). The lines removed from File1 are marked with a - (minus sign ) and those added
            to File2 are marked with a + (plus sign). Lines changed from one file to the other are marked in both files
            with an ! (exclamation point). Changes within the specified context lines of each other are grouped together as
            output.
       -D [ String ]
            Causes the diff command to create a merged version of File1 and File2 on the standard output. The C
            preprocessor controls are included so that a compilation of the result without defining String is equivalent to
            compiling File1, while defining String yields File2.
       -e
            Produces output in a form suitable for use with the ed editor to convert File1 to File2. When using this flag,
            the following shell program may help maintain multiple versions of a file. Only an ancestral file ($1) and a
            chain of version-to-version ed scripts ($2, $3, ...) made by the diff command need to be on hand. The latest
            version appears on the standard output as follows:

            (shift; cat $*; echo '1,$p') | ed - $1

            Extra commands are added to the output when the -e flag is used to compare directories, so the result is a
            shell script for converting text files that are common to the two directories from their state in Directory1 to
            their state in Directory2. Note: Editing scripts produced by the -e or -f flags cannot create lines consisting
            of a single . (period).
       -f
            Produces output in a form not suitable for use with the ed editor, showing the modifications necessary to
            convert File1 to File2 in the reverse order of that produced under the -e flag.
       -h
            Performs an alternate comparison that may be faster if the changed sections are short and well separated. The
            -h flag works on files of any length. The -c, -C, -D, -e, -f, and -n flags cannot be used with the -h flag. All
            other flags except the -b flag are ignored when used with the -h flag.
       -i
            Ignores the case of letters. For example, a lowercase a is treated the same as an uppercase A.
       -l
            Long output format. Each result from the diff command text file comparison is piped through the pr command for
            pagination. Other differences are remembered and summarized after all text file differences are reported.
       -n
            Produces output similar to that of the -e flag, but in the opposite order and with a count of changed lines on
            each insert or delete command. This is the form used by the revision control system (RCS).
       -r
            Causes application of the diff command recursively to common subdirectories encountered.
       -s
            Reports files that are the same and otherwise not mentioned.
       -S [ File ]
            Ignores files whose names collate before the file specified by the File variable when comparing directories.
            The -S flag only applies to the directories specified in the Directory1 and Directory2 parameters. If you use
            the -r flag with the -S flag, the -S flag does not work recursively in the Directory1 and Directory2
            subdirectories.

       -t
            Expands tabs in output lines. Typical output or the -c flag output adds characters to the front of each line,
            which may affect indentation of the original source lines and makes the output listing difficult to interpret.
            This flag preserves the original source's indentation.
       -w
            Ignores all spaces and tab characters and treats all other strings of blanks as equivalent. For example, if ( a
            == b ) compares equally to if(a==b).

'OS' 카테고리의 다른 글

[AIX] man netstat  (0) 2009.07.27
[dbx, truss, kdb, oslevel, lslpp] aix 5l 시스템 정보보기  (0) 2009.06.03
expr - 숫자계산  (0) 2009.04.08
유닉스 쉘 간단한 팁  (0) 2009.04.08
L4의 Hashing 정책  (0) 2009.03.03
Posted by marryjane
|

expr - 숫자계산

OS 2009. 4. 8. 18:16

http://blog.naver.com/yunki798?Redirect=Log&logNo=50031447749

+ : 더하기
- : 빼기
* : 곱하기('\*'로 사용)
/ : 나누기를 한 후의 몫의 값
% : 나누기를 한 후의 나머지 값
#!/bin/sh
#주의사항
#1. 역따옴표(``)를 사용한다.
#2. *연산자와 괄호'()' 앞에는 \(역슬래시)를 붙인다.
#3. 모든 연산자와 숫자, 변수, 기호 사이네는 space가 있어야 한다.
#4. = 사이에는 space가 있으면 안된다.
num=`expr 3 + 4 - 5`
echo $num  num2=`expr \( 3 \* 5 \) / 4 + 7`
echo $num2 
#"$$"는 스크립트 파일이 실행되는 프로세스 번호를 나타낸다.
A=linux
echo "1. \$A 의 값은 $A이다."
echo "2. \$A 의 값은 $$A이다."
echo "3. \$A 의 값은 $$$A이다."
echo "4. \$A 의 값은 '$A'이다."
echo "5. \$A 의 값은 "$A"이다."

'OS' 카테고리의 다른 글

[dbx, truss, kdb, oslevel, lslpp] aix 5l 시스템 정보보기  (0) 2009.06.03
[명령어]Diff  (0) 2009.05.18
유닉스 쉘 간단한 팁  (0) 2009.04.08
L4의 Hashing 정책  (0) 2009.03.03
jobs, fg, bg, stop, nohup - 작업제어명령  (0) 2009.02.26
Posted by marryjane
|

유닉스 쉘 간단한 팁

OS 2009. 4. 8. 14:32

오늘 날짜 받아오기
today=`date +%Y%m%d`

 [파일] 내에 [단어] 로 시작하는 줄의 2번째 파라메터 를 내림차순으로 정렬해서 [타겟]으로 출력하라
cat [파일] | grep [단어]  | awk '{print $2}' | sort -rn > [타겟]

 [파일] 내에 2번쨰 파라메터의 최대값
max=`head -1 [타겟]`

 [파일] 내에 시작줄에서 마지막줄 까지 더한값을 출력
sum=`awk 'BEGIN{sum1=0}{sum1+=$1}END{print sum1}' pool.log `

 수치계산 expr
avg=`expr ${sum} / ${avrCT}`

 tar.gz 압축/해제
gzip 옵션

-d :압축을 해제한다.
-l : 압축파일 안에 있는 파일 정보(압축된 사이즈, 압축율) 출력한다.
-r : 하위 디렉토리까지 모두 압축한다.
-S : 다른 확장자를 지정(기본값은 .gz)한다.
-v : 압축하거나 풀 때 압축율, 파일명을 출력한다.
 

tar 옵션

-A, --catenate, --concatenate : 저장 파일에 tar 파일을 추가한다.
-c, --create : 새 저장 파일을 만든다.
-d, --diff, --compare : 저장 파일 혹은 파일 시스템 간의 다른 점을 찾는다.
--delete : 저장 파일에서 지운다. (자기 테이프에는 쓰면 안됨!)
-r, --append : 저장 파일의 끝에 파일을 덧붙인다.
-t, --list : 저장 파일의 내용 목록을 보여준다.
-u, --update : 저장 파일에 저장된 사본보다 새로운 파일만을 덧붙인다.
-x, --extract, --get : 저장된 것에서 풀어낸다.
 

압축 : tar cvf - [타겟] | gzip > [타겟파일명].tar.gz
해제 : gzip -dc [타겟파일명].tar.gz | tar xvf -

'OS' 카테고리의 다른 글

[명령어]Diff  (0) 2009.05.18
expr - 숫자계산  (0) 2009.04.08
L4의 Hashing 정책  (0) 2009.03.03
jobs, fg, bg, stop, nohup - 작업제어명령  (0) 2009.02.26
truss - process trace  (0) 2009.02.26
Posted by marryjane
|

L4의 Hashing 정책

2009. 3. 3. 11:11

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.