SEO, Internet Marketing, Search Engine Optimization, Search Engine Marketing by www.websquash.com

Common Commands and Tools

  Common Command Introduction

The common command has the below :

   1. uname

    - Syntax :

        - uname [-a] - display information about computer system or set node name (system name)

     - Examples:

       % uname -a

        Display information about the current computer system

        HP-UX hp030 A.09.01 C 9000/750 2015882040 32-user license

        Note:

      hp030                                          The system network name.
      A.09.01                                       The operating system release identifier.
      C                                                 The operating system version identifier.
      9000/750                                     The machine and model numbers.
      2015882040                                The machine identification number.

      Description : 


  •    -a  Display all information specified with the -m,  -n, -r, -s , and -v flags.
                -  -m   Displays the machine ID number of the hardware running the system.
                -  -n    Displays the name of the node. This may be a name the system is known by to a UUCP communications network.
                -  -r     Displays the release number of the operating system.
                -  -s     Displays the system name. The flag is on by default.
                -  -v    Displays the operating system version.


   2.df

    - Syntax :

           - df [-k] - report number of free file system disk blocks

     - Examples :

            - #df - k

            /home                     (/dev/vg00/lvol5)   : 4162144  total allocated Kb 4159168 free allocated Kb  2976 used allocated Kb   , 0% allocation used

            /opt                         (/dev/vg00/lvol6)   :  2092904  total allocated Kb  , 622512 free allocated Kb,  1470392 used allocated Kb ,  70% allocation used  ....

  •      -k   Displays statistic in units of 1024-byte blocks.

   3.tail

     - Syntax : 

          - tail [-f] [-n number] [file] - deliver the last part of a file

     - Examples: 
      
          # tail -fn 3 file1

       Print the last three lines in file file1 to the standard output.

    Description : 

  •     -f    :  If the input file is a regular file or if the File parameter specified a FIFO (First-in-First-Out). The tail command does not terminate after the last specified unit of the input file has been copied, but continues to read and copy additional units from the input file as  they become available. If no File parameter is specified and standard input is a pipe, the -f flag is ignored. The tail -f command can be used to monitor the growth of a file being written by another process.
  •     -n Number :  Reads the specified file beginning at the line location indicated by the Number variable.

    4. head

     - Syntax : 

          - head [-n count] [file] - give first few lines

      - Examples :

        # head -n 3 file1
      Print the first three lines in file file1 to the standard output

     Description : 

  •    -n Number   :  Specifies the number of lines from the beginning of each specified file to be displayed. The number variable must be a positive decimal integer. The flag is equivalent to the -Count flag.

    5. sar

      - Syntax :

         - sar [-ubdycwaqvmAMPS] [-d] - system activity reporter

       - Examples : 

         #sar -u 5  1

        Watch CPU activity evolve for 1 seconds
         HP-UX mscp2 B.11.11 U 9000/800    12/28/06

       09:10:12         %usr        %sys         %wio         %idle
       09:10:13             4          0         0         98
       09:10:14             3          1         0         98
       09:10:15             7          0         0         95
       09:10:16             4          0         0         94
       09:1017              5          0         0         95

   Available                4          0         0         95

  •     -d     Reports activity for each block device with the exception of tape drives.
  •     -u     Reports per processor or system-wide statistics. When used with the -P flag, the information is provided for each specified processor; otherwise, it is provided only system-wide. Because the -u flag information is expressed as percentages, the system-wide information is simply the average of each individual processor's statistics. Also , the I/O wait state is defined system-wide and not per processor.
  •  - A   Report all data.
  • Example :  
             # sar -u 1  5  
  • Result description :
             - %usr                       user mode;
             - %sys                       system mode;
             - %wio                      idle with some process waiting for I/O (only block I/O, raw I/O, or VM pageins/swapins indicated);
             - %idle                     otherwise idle .

  •   Example :
  •   #sar  -d  1   5
           Report activity for each block device, for example, disk or tape drive

  •    Result description : 
            - device          : Logical name of the device and its corresponding instance. Devices are categorized into the following device types :

                            - disk3    - SCSI and NIO FL disks
                            - sdisk    - SCSI disks;

             -  %busy         : Portion of time device was busy servicing a request;
             -  avque          : Average number of requests outstanding for the device;
             -  r+w/s           :  Number of data transfers per second (read and writes) from and to the device;

              - blks/s           : Number of bytes transferred (in 512-byte units) from and to the device;
              - avwait          : Average time (in milliseconds) that transfer requests waited idly on queue for the device;

               - avserv         : Average time (in milliseconds) to service each transfer request (includes seek, rotational latency, and data transfer times) for the device.



   6. tar

    - Syntax : 

          - tar [-] key [arg...] [file | -c directory]  - tape file archiver

     - Examples : 

        $ tar  cvf  file.tar   file1   file2   file3

      To archive file1 , file2  and file3  into file.tar

        $ tar  tvf  file.tar

       To display the contents of a archived file  file.tar

        $ tar xvf   file.tar

        To unachieve a archived file file.tar into current directory

     Description : 



  • The Function portion of the key is specified by exactly one of the following letters:
             -  -c  : Creates a new archive and writes the files specified by one or more File parameters to the beginning of the archive.

             - -t  : Lists the files in the order in which they appear in the archive. Files can be listed more than once.

             -  -x  : Extracts the files specified by one or more File parameters from the archive.If the File parameter refers to a directory, the tar command recursively extracts that directory from the archive. If we do not specify the File parameter, the tar command extracts all of the files from the archive. When an archive contains multiple copies of the same file, the last copy extracted overwrites all previously extracted copies. If we have the proper permissions, the tar command  restores all files and directories with the same owner and group IDs as they have on the tape. If we do not have the proper permissions, the files and directories are restored with our owner and group IDs. It is not possible to ask for any occurrence of a file other than the last.

  •  [arg...]     The b and f function modifiers each require and arg argument . If both b and f are specified, the order of the arg arguments must match the order of the modifiers. If specified, the arg arguments must be separated from the key and each other by whitespace.
               -  b  : Use the next arg argument as the blocking factor for archive records. The default is 20; the maximum is at least 20. However, if the f - modifier is used to specify standard input, the default blocking factor is 1.
               -   f   :  Archive Uses the Archive variable as the archive to be read or written. When this flag is not specified, the tar command uses a system-dependent default file name of the form /dev/rmt0. If the Archive variable specified is  - (minus sign), the tar command writes to standard output or reads from standard input. If we write to standard output, the  -c flag must be used.

               -   -v   : Lists the name of each file as it is processed. With the  -t flag,  -v gives more information about the tape entries, including file sizes, times of last modification, User Number (UID), Group Number (GID), and permissions.


-------------------------------------------------------------------------------------------------------------------

     7. compress , uncompress

    - Syntax  :

             - compress [-v] file - compress data

             - uncompress file, compress [-d]  - compress and expand data

     - Examples :

        # compress  -v mytext.Z

       Compress the file named mytext and print compression information to the terminal.

        # uncompress mytext.Z

        # compress -d mytext.Z

      Undo the compression by typing either of the commands above.


  • After compressing a file, the file is always like  *.Z
  • Example :
            # compress text.tar

            # ls text*

           test.tar.Z

  •   -d  :  Causes the compress command to function exactly like the uncompress command.
  •   -v  :  Writes the percentage of compression.
----------------------------------------------------------------------------------------------------------------------

    8.ps

     - Syntax :

          - ps [-e] [-f]  --  report process status

      - Examples:

        # ps -ef

     Generate a full listing of all processes currently running on your machine.

UID          PID       PPID       C          STIME       TTY              TIME         COMMAMD

 root            0            0           0           Dec 22        ?                    0:47          swapper

root             8            0           0           Dec 22        ?                   0:50           supsched


    Description : 

  •   uid      :  The user ID number of the effective process owner.
  •   pid      :  The process ID number of the process.
  •   ppid    :  The process ID number of the parent process.
  •   cpu     :   processor utilization for scheduling. The default heading for this column is C
  •   stime  :   Starting time of the process. If the elapsed time is greater than 24 hours, the starting date is displayed instead.
  •   tty      :   The controlling terminal for the process. The default heading for this column is TT if -o is specified and TTY otherwise.
  •   time   :  The comulative execution time for the process.
  •   -e       :   List information about every process now running.
  •   -f       :    Show columns user, pid , ppid, cpu , stime, tty, time, and args, in that order.   

---------------------------------------------------------------------------------------------------------------------




Share on Google Plus

About Unknown

0 comments:

Post a Comment

If there is any comments,Please leave a comment at here.

loading...
Sponsor by