01-16 m2000 command reference(ha)

63
16 M2000 Command Reference (HA) About This Chapter This chapter describes the functions and usage of some common commands used for the M2000 HA system. These commands are related to the M2000 and the UNIX operating system. 16.1 M2000 Commands (HA) This describes the functions and usages of the M2000 commands that are used in the M2000 HA system. 16.2 Sun Cluster Commands This describes the functions and usage of the Sun Cluster commands that are commonly used in the M2000 HA system. 16.3 UNIX Commands This describes the utility commands provided by the UNIX system, including the commands for operating directories, the commands for operating folders, the commands for viewing files, the commands for managing UNIX users, the commands for managing the system resource, and the commands for network communication. M2000 HA System Administrator Guide (S10) 16 M2000 Command Reference (HA) Issue 06 (2008-03-18) Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd 16-1

Upload: moussa-karim-alio

Post on 12-Sep-2015

243 views

Category:

Documents


2 download

DESCRIPTION

M2000 HA Command reference

TRANSCRIPT

  • 16 M2000 Command Reference (HA)About This Chapter

    This chapter describes the functions and usage of some common commands used for theM2000 HA system. These commands are related to the M2000 and the UNIX operating system.

    16.1 M2000 Commands (HA)This describes the functions and usages of the M2000 commands that are used in the M2000HA system.16.2 Sun Cluster CommandsThis describes the functions and usage of the Sun Cluster commands that are commonly usedin the M2000 HA system.16.3 UNIX CommandsThis describes the utility commands provided by the UNIX system, including the commands foroperating directories, the commands for operating folders, the commands for viewing files, thecommands for managing UNIX users, the commands for managing the system resource, and thecommands for network communication.

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-1

  • 16.1 M2000 Commands (HA)This describes the functions and usages of the M2000 commands that are used in the M2000HA system.

    16.1.1 svc_profile.sh ScriptThis describes the function, path, and method of running the svc_profile.sh script. Before yourun the commands on the M2000, you must run svc_profile.sh to set the operating environment.16.1.2 svc_adm -cmd status CommandThis describes the function of the svc_adm -cmd status command and the users authorized torun this command. It also provides an example to explain the application.16.1.3 svc_ps CommandThis describes the function of the svc_ps command and the users authorized to run this command.This also gives examples for the application of this command.16.1.4 svc_adm -cmd reload CommandThis describes the function and user identity of the svc_adm -cmd reload command. Thecommand is used to update the M2000 configuration information. This also gives an exampleto explain the application of the command.16.1.5 svc_stacks CommandThis describes the function of the svc_stacks command and the users authorized to run thiscommand. It also provides an example to explain the application of this command.

    16.1.1 svc_profile.sh ScriptThis describes the function, path, and method of running the svc_profile.sh script. Before yourun the commands on the M2000, you must run svc_profile.sh to set the operating environment.

    FunctionBefore you run the commands on the M2000, run svc_profile.sh. This script sets the useroperating environment such as the searching path and the dynamic searching path.

    PathThe script is saved in the M2000 Server Installation Directory.

    Operating MethodThere are two ways to run the script: manually and automatically.l Run the script manuallyTake the M2000 default directory /opt/OMC as an example. To manually run the script, run thefollowing command:-bash-3.00$ . /opt/OMC/svc_profile.sh

    NOTE

    The symbol . exists before the command, and a space exists between the mark . and the mark /.

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-2 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • l Run the script automatically

    After the system is installed correctly, the script is added to the .profile file of user omcuser anduser root. If you log in to the system as user omcuser or user root, the system automatically runsthe script.

    16.1.2 svc_adm -cmd status CommandThis describes the function of the svc_adm -cmd status command and the users authorized torun this command. It also provides an example to explain the application.

    FunctionThe svc_adm -cmd status command is used to check the operational status of all the M2000services.

    Permitted UsersUsers root, omcuser, and dbuser are authorized to run the svc_adm -cmd status command.

    Example-bash-3.00$ svc_adm -cmd statusThe status of the M2000 services is Running, No License, or Not Running.

    16.1.3 svc_ps CommandThis describes the function of the svc_ps command and the users authorized to run this command.This also gives examples for the application of this command.

    FunctionThe svc_ps command is used to check the operational status of the M2000 service processes.

    Permitted UsersUsers root, omcuser, and dbuser are authorized to run the svc_ps command.

    Example-bash-3.00$ svc_psThe command result shows all the M2000 processes that are running.

    16.1.4 svc_adm -cmd reload CommandThis describes the function and user identity of the svc_adm -cmd reload command. Thecommand is used to update the M2000 configuration information. This also gives an exampleto explain the application of the command.

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-3

  • FunctionThis command loads the configuration file to the configuration module to update theconfiguration in real time. This means that the M2000 services are not stopped when the systemupdates the configuration information.

    Permitted UsersUsers root, omcuser, and dbuser are authorized to run the svc_adm -cmd reload command.

    Example-bash-3.00$ svc_adm -cmd reloadAfter you run the command, the data in the configuration module is the same as the data in theconfiguration files.

    16.1.5 svc_stacks CommandThis describes the function of the svc_stacks command and the users authorized to run thiscommand. It also provides an example to explain the application of this command.

    FunctionThe svc_stacks command collects the stack information on the M2000 service processes forlocating and debugging system faults.

    Permitted UsersUser root is authorized to run this command.

    Example# svc_stacksThe queried stack information is stored in the file /M2000 server installation path/var/logs/imap_stacks.YY_MM_DD__HH_NN_SS.trace. The default installation path of the M2000server software is /opt/OMC.The result file is identified on the basis of the query time. In the file name, YY stands for year,MM for month, DD for day, HH for hour, NN for minute, and SS for second.

    16.2 Sun Cluster CommandsThis describes the functions and usage of the Sun Cluster commands that are commonly usedin the M2000 HA system.

    16.2.1 scstat CommandThis describes the function and parameters of the scstat command. It also provides an exampleto explain the application of this command.16.2.2 scrgadm CommandThis describes the function and parameters of the scrgadm command. It also provides an exampleto explain the application of this command.

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-4 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • 16.2.3 scswitch CommandThis describes the function and parameters of the scswitch command. It also provides an exampleto explain the application of this command.16.2.4 Summary of Commonly Used Cluster CommandsThis describes the common maintenance commands of the Cluster 3.0.

    16.2.1 scstat CommandThis describes the function and parameters of the scstat command. It also provides an exampleto explain the application of this command.

    FunctionThe scstat command is used to query the Cluster status.

    Parameter Descriptionl -D: queries the information about a disk device group.l -p: queries the information about Cluster components.l -n: queries the information about a node.l -q: queries the information about the rated devices.l -W: queries the current status of the Cluster connection.

    ExampleTo check the status of a resource group, run the following command:scstat -g

    16.2.2 scrgadm CommandThis describes the function and parameters of the scrgadm command. It also provides an exampleto explain the application of this command.

    FunctionThe scrgadm command is used to manage the registration of resource types, the creation ofresource groups, and the activation of resources in the group.

    Parameter Descriptionl -p: displays the information about the current resource, resource group, and resource type.l -pv: displays the resource groups and device groups on the current host.l -a: creates a resource group or a resource type.l -r: deletes a resource group or a resource type.-h host name: specifies the host associated

    with the command.l -l host name: specifies the logical host associated with the command.l -g resource group name: specifies a resource group associated with the command.l -j resource name: specifies a resource associated with the command.

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-5

  • l -t resource type: specifies a resource type associated with the command.

    ExampleTo register osssvr-1 and osssvr-2 to the resource group oss_rg, run the following command:scrgadm -a -g oss_rg -h osssvr-1,osssvr-2

    16.2.3 scswitch CommandThis describes the function and parameters of the scswitch command. It also provides an exampleto explain the application of this command.

    FunctionThe scswitch command is used to change the state of resource groups and disk device groups.

    Parameter Descriptionl -S: switches out all the device groups and resource groups from the specified host.l -e: activates a resource.l -n: deactivates a resource.l -z: changes the control of a device group and a resource group.l -h host name: specifies the host associated with the command.l -D resource group name: specifies a device group associated with the command.l -g resource group name: specifies a resource group associated with the command.l -j resource name: specifies the resources associated with the command.

    ExampleTo start the resource group oss_rg on the host osssvr-1, run the following command:scswitch -z -g oss_rg -h osssvr-1

    16.2.4 Summary of Commonly Used Cluster CommandsThis describes the common maintenance commands of the Cluster 3.0.

    Table 16-1 Common maintenance commands of the Cluster3.0Command Descriptionscstat Check the Cluster status.scstat -g Check the status of a resource group.scrgadm -a -g oss_rg Create the resource group oss_rg.scrgadm -r -g oss_rg Delete the resource group oss_rg.scrgadm -a -g oss_rg -h osssvr-1,osssvr-2 Register osssvr-1 and osssvr-2 to the

    resource group oss_rg.

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-6 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • Command Descriptionscrgadm -a -L -g oss_rg -l osssvr Register the logical host osssvr to the

    resource group oss_rg.scrgadm -a -j ossdg_rs -g oss_rg -tSUNW.HAStoragePlus -xFilesystemMountPoints=data,/export/home

    Register the volume group ossdg_rg-t andmounting point data,/export/home to theresource group oss_rg.

    scrgadm -a -t HW.M2000 Register the resource type HW.M2000 inthe Sun Cluster 3.0. The link file namedHW.M2000 must be created in the /usr/cluster/lib/rgm/rtreg folder.

    scrgadm -r -t HW.M2000 Delete the resource type HW.M2000 .scrgadm -a -j ossapp_rs -t HW.M2000 -goss_rg

    Add the resource ossapp_rs of theHW.M2000 type to the resource grouposs_rg.

    scrgadm -r -j sybase_rs Delete the resource sybase_rs.scswitch -Z -g oss_rg Start all resources in the resource group

    oss_rg, including the resourcesdeactivated by scswitch -n -j.

    scswitch -F -g oss_rg Close the resource group oss_rg.scswitch -z -g oss_rg -h osssvr-1 Start the resource group oss_rg on the host

    osssvr-1.scswitch -S -h osssvr-1 Switch resources to osssvr-2scswitch -e -j sybase_rs Activate the resource sybase_rs and

    enable the Cluster monitoring over theSybase.

    scswitch -n -j sybase_rs Deactivate the resource sybase_rs andstop the Cluster monitoring over theSybase.

    NOTE

    l After you run the command scswitch -S -h nodename, all online resource groups are switched to thetarget PC. The offline resource groups on the original host remain offline on the target PC.

    l After you run the command scswitch -z -g rgname -h nodename, the resource group rgname isswitched to the target PC.

    16.3 UNIX CommandsThis describes the utility commands provided by the UNIX system, including the commands foroperating directories, the commands for operating folders, the commands for viewing files, thecommands for managing UNIX users, the commands for managing the system resource, and thecommands for network communication.

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-7

  • 16.3.1 Commands for Operating UNIX FoldersThis describes the commands for operating UNIX folders. This also gives function descriptionsand examples.16.3.2 Commands for Operating UNIX FilesThis describes the usage of the operation commands commonly used for files in the UNIXoperating system, including function description and application examples.16.3.3 Commands for Viewing UNIX Text FilesThis describes the commands used for viewing UNIX text files, their functions, along withexamples.16.3.4 Commands for Managing UNIX UsersThis describes the user management commands that are frequently used in the UNIX system.This also describes the functions of these commands and gives some examples. Only user rootand the authorized users can add, modify, or delete users and user groups.16.3.5 Commands for Managing UNIX System ResourcesThis describes the commands for managing UNIX system resources. This also describes thefunctions of these commands and gives some examples.16.3.6 Commands for Network Communication on the UNIX SystemThis describes the commands for network communication on the UNIX system. This alsodescribes the functions of these commands and gives some examples.

    16.3.1 Commands for Operating UNIX FoldersThis describes the commands for operating UNIX folders. This also gives function descriptionsand examples.

    16.3.1.1 pwd CommandThis describes the function and example of the pwd command. The pwd command is used toview the current working folder.16.3.1.2 cd CommandThis describes the function and example of the cd command.16.3.1.3 mkdir CommandThis describes the function and example of the mkdir command.16.3.1.4 rmdir CommandThis describes the function and example of the rmdir command.16.3.1.5 ls CommandThis describes the function, format, option, parameter, and example of the ls command.

    pwd CommandThis describes the function and example of the pwd command. The pwd command is used toview the current working folder.

    FunctionView the current working folder.

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-8 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • Example# pwd/export/home/sybase

    NOTEUnlike DOS, the UNIX system does not always display the folder name. You must run the pwd commandperiodically to view the current working folder.

    cd CommandThis describes the function and example of the cd command.

    FunctionThe cd command is used to switch the current folder to another folder. This command appliesto both absolute and relative paths.

    Examplel To switch to the home folder, run the following command:# cdl To switch to the system root directory, run the following command:# cd /l To switch back one folder, run the following command:# cd ..l To switch back two folders, run the following command:# cd ../..l To switch to the /export/home/sybase folder by the absolute path, run the following

    command:# cd /export/home/sybase

    NOTEIf you run the cd command that is not followed by any parameter, the system is switched back to the homefolder.

    mkdir CommandThis describes the function and example of the mkdir command.

    FunctionThe mkdir command is used to create a folder. When the path to the created folder is determined,absolute and relative paths can be used.

    ExampleTo create a subfolder data in /home1/omc, run the following command:

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-9

  • # mkdir /home1/omc/dataIf the current folder is /home1/omc, run the following command:# mkdir data

    rmdir CommandThis describes the function and example of the rmdir command.

    FunctionThe rmdir command is used to delete an empty folder.

    CAUTIONl If the folder to be deleted is not empty, you must delete the files in the folder before running

    the rmdir command.l To delete the current folder, you must switch to the upper-level folder.

    ExampleTo delete the data subfolder in the /home1/omc folder, run the following command:# rmdir /home1/omc/dataIf the current folder is /home1/omc, run the following command:# rmdir data

    ls CommandThis describes the function, format, option, parameter, and example of the ls command.

    FunctionThe ls command is used to list the files and subfolders in a folder. Run the ls command withoutany parameter to list the content of the current folder. Run the ls command with parameters tolist the information about the size, type, and privileges of the file, and the date when the file wascreated and modified.

    Command Formatls Option Directory or File

    Option DescriptionSeveral individual options and a combination of options can be used for the ls command. Placethe prefix - before the options. Table 16-2 lists some common options.

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-10 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • Table 16-2 Option description of the ls commandOption Description-a Lists all files including the hidden files, that is, the files starting with a

    dot ., for example, the .login file.-F Specifies the type of a file by suffix signs.

    The meaning of the suffixes are as follows:l /: for folder filesl =: for pipe filesl @: for sign-linking filesl *: for executable files

    -l Lists the detailed information about a file, such as the file type, privileges,number of links, owner, file group, file size, file name, and the date of the lastmodification.

    If the file is a sign-linking file, then the -> sign is added at the end of the file name for pointingto the linked file.

    ExampleTo view the long-form content of the files in the current folder, run the following command:# ls -l |moretotal 11094632drwxr-xr-x 2 sybase staff 1024 Sep 5 2001 bindrwxr-xr-x 14 sybase staff 512 Sep 5 2001 charsetsdrwxr-xr-x 3 sybase staff 512 Sep 5 2001 collatedrwxr-xr-x 2 sybase staff 512 Sep 5 2001 config-rw-r--r-- 1 sybase staff 2048000000 Mar 6 09:50 data_dev.datdrwxr-xr-x 2 sybase staff 512 Sep 5 2001 devlibdrwxr-xr-x 7 sybase staff 512 Sep 5 2001 diagdrwxr-xr-x 2 sybase staff 512 Sep 5 2001 hs_datadrwxr-xr-x 2 sybase staff 512 Sep 5 2001 includedrwxr-xr-x 7 sybase staff 512 Sep 5 2001 initdrwxr-xr-x 3 sybase staff 512 Sep 5 2001 install-rw-r--r-- 1 sybase staff 268 Sep 5 2001 interf.old-rw-r--r-- 1 sybase staff 402 Oct 29 15:25 interfacesdrwxr-xr-x 2 sybase staff 1024 Sep 5 2001 libdrwxr-xr-x 2 sybase staff 512 Sep 5 2001 licensedrwxr-xr-x 6 sybase staff 512 Sep 5 2001 locales-rw-r--r-- 1 sybase staff 2048000000 Mar 6 10:51 log_dev.dat-rw-r--r-- 1 sybase staff 2048000000 Mar 6 10:36 log_dev1.datdrwxr-xr-x 5 sybase staff 512 Sep 5 2001 pad-rw-r--r-- 1 sybase staff 5242880 Feb 19 10:10 phase2.datdrwxr-xr-x 8 sybase staff 512 Sep 5 2001 sample--More--

    After you run the ls -l command, the result may be displayed in several screens. To view the filecontents, one screen at a time, run one of the following commands:l # ls -la | morel $ ls -la>ccc

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-11

  • Save the command output to the ccc file, and then run the following command to view theoutput on screen at a time:# more ccc

    After you run the ls -l command, seven columns of information are displayed, which aredescribed as follows:l The first column consists of 10 characters. The first character indicates the file type. For

    example, the character - refers to a common file and the character d refers to a folder. Thefollowing nine characters are three triplets indicating the access privileges of the file owner.The first triplet pertains to the owner, the middle triplet pertains to members of the usergroup, and the right-most one pertains to other users in the system. For example, thecharacters r, w, and x indicate that the user has the privileges to read, write, and execute afile, whereas the character - indicates that the user does not have any relevant privilegesfor the file.

    l The second column indicates the number of links of the file.l The third and fourth columns display information such as the owner of the file, and the user

    group to which the file belongs.l The fifth column shows the size of the file in bytes.l The sixth column shows the time and date when the file is last modified.l The seventh column shows the file name.

    16.3.2 Commands for Operating UNIX FilesThis describes the usage of the operation commands commonly used for files in the UNIXoperating system, including function description and application examples.16.3.2.1 cp CommandThis describes the function, format, option, and parameter of the cp command. It also providesan example of the cp command.16.3.2.2 mv CommandThis describes the function, format, and example of the mv command.16.3.2.3 rm CommandThis describes the function, format, option, and example of the rm command.16.3.2.4 chmod CommandThis describes the function, format, option, and example of the chmod command.16.3.2.5 chown CommandThis describes the function, format, option, parameter, and example of the chown command.16.3.2.6 chgrp CommandThis describes the function, format, option, parameter, and example of chgrp command.16.3.2.7 find CommandThis describes the function, format, parameter, and example of the find command.16.3.2.8 tar CommandThis describes the function, format, option, and example of the tar command.16.3.2.9 gtar CommandThis describes the function, format, parameter options, and instance of the gtar command.16.3.2.10 compress Command

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-12 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • This describes the function, format, and example of the compress command.16.3.2.11 uncompress CommandThis describes the function, format, and example of uncompress command.16.3.2.12 pack CommandThis describes the function, format, and example of the pack command. The pack command isused to compress files and save memory space.16.3.2.13 unpack CommandThis describes the function, format, and example of the unpack command.16.3.2.14 pkgadd CommandThis describes the function, format, option, and example of the pkgadd command.16.3.2.15 pkgrm CommandThis describes the function, format, and example of the pkgrm command.

    cp CommandThis describes the function, format, option, and parameter of the cp command. It also providesan example of the cp command.

    FunctionThe cp command is used to copy the contents of a file to another file.

    Command Formatcp option source file object file

    Option DescriptionThe option -r indicates recursively copying a folder. That is, when copying a folder, copy thefiles and subfolders included in the folder, and files and subfolders in the subfolders until thelast level of the folder.

    ExampleTo copy the old_filename file in the current folder to the file new_filename, run the followingcommand:# cp old_filename new_filename

    mv CommandThis describes the function, format, and example of the mv command.

    FunctionThe mv command is used to move and rename a file.

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-13

  • CAUTIONl After you run the mv command, only the target file instead of the source file exists.l After you run the cp command, the source file still exists and the target file is generated.

    Command Formatmv source file object file

    ExampleTo move the old_filename file in the root directory to the /home1/omc folder, and rename thesource file to new_filename, run the following command:# mv old_filename /home1/omc/new_filename

    rm CommandThis describes the function, format, option, and example of the rm command.

    FunctionThe rm command is used to delete a file.

    CAUTIONl In the UNIX system, a file, once deleted, cannot be restored. Therefore, use the -i option

    to avoid the deletion of a file by mistake.l To delete a folder, run either of the following commands: rmdir or rm -r. The difference

    between the two commands is: rmdir deletes only empty folders but rm -r deletes anyfolder.

    Command Formatrm Option file

    Option Descriptionl -i: refers to interactive operations. Your confirmation is required before a command is run.l -r: recursively deletes a folder. That is, when deleting a folder, delete the files and subfolders

    included in the folder, and files and subfolders in the subfolders until the root folder.

    ExampleTo delete the old_filename file in the current folder, run the following command:# rm -i old_filename

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-14 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • chmod CommandThis describes the function, format, option, and example of the chmod command.

    FunctionThe chmod command is used to change the access rights of a directory or a file.

    Formatchmod option directory or fileBased on different notation methods of the option in the command, two modes are available:l Symbol mode

    chmod objectoperatorrights filel Digit mode

    chmod lmn file

    Option Descriptionl Symbol mode

    Table 16-3 lists common options in symbol mode of the chmod command.

    Table 16-3 Common options in symbol mode of the chmod commandOption Option Detail DescriptionObject u Owner of a file

    g Users sharing the same groupwith the file owner

    o Other users except the file ownerand the users sharing the samegroup with the file owner

    a All usersOperator + Add a right

    - Cancel a right= Set a right

    l Digit mode

    The option lmn represents the following digits: l: the rights of the owner m: the rights of the users sharing the same group with the owner n: the rights of other users in the systemThe value of each digit is equal to the sum of the values of r (read right), w (write right),x (execute right), or - (no right) in each group. In each group, r = 4, w = 2, x = 1, and - =0. In the following example -rwxr-xr-- 1 rms sbsrms 46098432 May 12

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-15

  • 16:02 sdh*, the access rights of the file sdh is represented by the symbols rwxr-xr--. The nine symbols are divided into three groups, with three symbols as a group. Thethree groups represent the rights of the file owner, the rights of the users sharing the samegroup with the file owner, and the rights of other users in the system. The three groups canbe represented in digits 754, which is calculated according to the formulas: 7 = 4 + 2 + 1,5 = 4 + 0 + 1, and 4 = 4 + 0 + 0.

    Parameter DescriptionFile: indicates the name of the file whose rights are changed.

    Examplel Symbol mode

    Authorize the file1 owner with the read, write, and execute rights. Authorize the userssharing the same group with the file owner with the read and execute rights. Authorizeother users with the read and execute rights. Run the following command:# chmod u=rwx,go=rx file1To authorize all the users with the read and write rights, run the following command:# chmod a=rw file2

    l Digit modeAuthorize the file1 owner with the read, write, and execute rights. Authorize the userssharing the same group with the file owner with the read and execute rights. Authorizeother users with the read and execute rights. Run the following command:# chmod 755 file1To authorize all the users with the read and write rights, run the following command:# chmod 666 file2

    NOTE

    l To configure the rights of a file for users in a group and other users in the system in symbol mode,you must authorize these users with the execute right of the directory where a file exists. Run thefollowing command for the directory that requires you to set rights:# chmod u=rw,+x .You can also run the following command:# chmodu=rwx,go=x .In this command, the symbol "." indicates the current directory.

    l In digit mode, r = 4, w = 2, x = 1, and - = 0. These mappings are set according to the binary mode.For the three symbols in a group, which represent the read right, the write right, and the execute right,assign the binary value 1 if a symbol has the corresponding right and assign the binary value 0 if asymbol does not have the corresponding rights. Take the previous file sdh as an example. The filerights are represented by the symbols rwxr-xr--. After converting the symbols into a binary value,you can obtain "111101100". The binary value is divided into three 3-digit groups, with each grouprepresenting a file right. After converting the binary value of each group into a decimal value, youcan obtain three values: 7, 5, and 4.

    chown CommandThis describes the function, format, option, parameter, and example of the chown command.

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-16 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • FunctionThe chown command is used to modify the owner of a file. In most UNIX systems, this commandcan be run only by the super user.

    Command Formatchown Option owner file

    Option Descriptionl -f: runs the command forcibly without displaying errorsl -R: recursive folder

    Parameter Descriptionl Owner: the modified ownerl File: the file of the owner to be modified

    Examplel Assume that there is a user new_owner and a file in the system. Run the following command

    to change the owner of the file to new_owner:# chown new_owner file

    l Assume that there is a user M2000 in the system. Change the owner of all files in the /export/home/sybase folder and the subfolders to M2000:# chown CR M2000 /export/home/sybase

    chgrp CommandThis describes the function, format, option, parameter, and example of chgrp command.

    FunctionThe chgrp command is used to move all files from the user group to which you belong, to anotheruser group. That is, you belong to at least two user groups at the same time.

    Command Formatchgrp Option group file

    Option Descriptionl -f: runs the command forcibly without displaying errorsl -R: recursive folder

    Parameter Descriptionl Group: the modified user groupl File: the file the user group of which is to be modified

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-17

  • ExampleTo change the user group file to new_group, run the following command:# chgrp new_group file

    CAUTIONThe new user group to which a file is moved should be created. Run the groups command tolist the groups to which you belong. For details on how to create a user group, see 16.3.4Commands for Managing UNIX Users.After the owner or group of a folder is changed, the folder does not belong to that user or usergroup any more. The attributes of the subfolders and files in the folder, however, are retained.Run the chown command to modify the owner and the user group of a file at the same time:# chown omc:staff file1For example, run the command to modify the owner of file1 to omc and the group to staff.

    find CommandThis describes the function, format, parameter, and example of the find command.

    FunctionThe find command is used to search for a file that meets the preset conditions in the specifiedfolders and subfolders. By using this command, you can find the file even if you forget the correctpath of the file.

    Command Formatfind folder condition

    Parameter Descriptionl Folder: indicates the folder to be searched. You can enter multiple folder names. Separate

    the folder names by using spaces.l Condition: indicates the conditions for file search, such as the file name, owner, and time

    of the last modification.Table 16-4 describes the conditions for file search.

    Table 16-4 Conditions for file searchCondition Description-name name The name of the file or folder to be searched.

    Wildcards, such as -name '*.c', can be used.-print Prints the path that meets the conditions.-size n Searches for the files that use n blocks.

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-18 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • Condition Description-type x Searches for files by file type. The file type x includes:

    l d: directoryl f: filel b: blockl c: characterl p: pipe

    -user user Searches all files of user. The value of user can be auser name or UID.

    -group group Searches all files of the user group. The value of groupcan be a user group name or GID.

    -links n Searches all files with the number of links as n.-atime n Searches the files accessed before n days.-mtime n Searches the files modified before n days.-exec command {}\; Uses the found file as the object of the command to be

    run. Put the parameters to be used in the commandexecution between { and }.

    Table 16-5 describes the logical operators of conditions.

    Table 16-5 Logical operators of conditionsLogicalOperator

    Meaning

    Example Description

    ! non ! -name "*.c" All the files except those withthe extension name as .c

    -o or -size +10 -o -links 3 All the files with more than 10blocks or with 3 links

    and -size +10 -links 3 All the files with more than 10blocks and with 3 links

    In the preceding table, +10 stands for more than 10 blocks and -10 for fewer than 10 blocks.

    ExampleTo search for files in the /tmp folder with the file name starting with c, and then print the paths,run the following command:# find /tmp -name "c*" -print/tmp/ctisql_0WBJgt/tmp/ctisql_0dznJ_

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-19

  • /tmp/ctisql_0CpW34/tmp/ctisql_0FO4vs

    To search the file test in the current folder and then print the paths, run the following command:# find . -name test -print./Report/reloc/resin1.2.0/conf/test./Report/reloc/resin1.2.0/doc/examples/login/WEB-INF/classes/test./Report/reloc/resin1.2.0/doc/examples/tags/WEB-INF/classes/test

    NOTE

    l The search may take several minutes. To save time, you can run this command in the background.That is, the output for the command is exported to a file for later query. End the command line with& so that the system runs the command in the background. For example,# find / -name "abc*" -print > abc.file &

    l After the search is complete, run the following command to view the result of the search:# cat abc.file

    l Different users may have different privileges for the same file. Therefore, ordinary users may findonly some files of the system. To list all the files that meet the set conditions, log in as a super userand search from the root directory.

    tar CommandThis describes the function, format, option, and example of the tar command.

    FunctionThe tar command is used to combine several files into one archive and save it to a tape or disk.When one of the files is required, obtain the file directly from an archive.

    Command Formattar function options modification options file

    Option Descriptionl function options: sets the actions, such as read and write, of the tar commandl modification options: modifies the actions of the tar commandTable 16-6 describes the options of the tar command.

    Table 16-6 Option description for the tar commandOption Specified

    OptionDescription

    Function options r Adds the specified file to an archive.x Reads a file in an archive. If the file name is a

    folder, this option reads the subfolders includedin the folder. This option is often used.

    c Creates an archive. This option is often used.

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-20 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • Option SpecifiedOption

    Description

    g Creates a file at the beginning of an archive ratherthan add the file in the last file.

    Modificationoptions

    v Activates the display mode. The names of all theprocessed files are displayed. This option is oftenused.

    w Activates the confirmation mode. Yourconfirmation is required before each file isprocessed.

    f Indicates that an archive is a file. If this parameteris skipped, the preset tape or disk is used as theobject. This option is often used.

    Examplel Run the tar command to back up files.

    To back up all the files and subfolders in the /export/home/sybdev folder in the currentfolder to the default device and view the file information during the backup, run thefollowing command:# tar cv /export/home/sybdevIn current folder, back up all the files and subfolders in the /export/home/sybdev folderto the databak.tar file, and to view the file information during the backup, run the followingcommand:# tar cvf databak.tar /export/home/sybdev

    l Use tar to restore files.To restore the files in the default device to a hard disk, and to view the file informationduring the restoration, run the following command:# tar xvIn current folder, restore the databak.tar file to the /export/home/sybdev folder, and toview the file information during the restoration, run the following command:# tar xvf databak.tar

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-21

  • CAUTIONl Do not enter "-" on the left of the function and modification options in the tar command.l Run the following tar command to pack several files into a package:

    # tar cvf filebak.tar file1 file2 file3l Run the previous command to pack file1, file2, and file3 into a package named

    filebak.tar.l The names of the disk and tape devices used in file backup and restoration in the tar

    command may vary according to the UNIX system. Check carefully before running thecommand.

    gtar CommandThis describes the function, format, parameter options, and instance of the gtar command.

    FunctionThe gtar command can merge multiple files into an archive and store it in tapes or disks. Youcan obtain the required files from an archive, if required.

    Formatgtar function options modification options file to be backed up or restored

    Option Descriptionl Function option: sets the actions of the gtar command, such as read or write.l Modification option: modifies the actions of the gtar command.Table 16-7 lists some options.

    Table 16-7 Descriptions of gtar command optionsOption Example DescriptionFunction option r Adds the specified file to end of an archive.

    x Reads a file in the archive. If the name is a directory, its subdirectories are also read. This option is common.

    c Creates a new archive. This option is common.g Creates a file from the beginning of the archive instead of

    the end of the last file.Modificationoption

    v Starts the display mode. The gtar command can display allnames of the processed file. This option is common.

    w Activates the confirm mode. The gtar command requestsyou to confirm before processing each file.

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-22 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • Option Example Descriptionf Indicates that the archive is a file. Omission of this option

    indicates that the object is the preset disk or tape. This optionis common.

    Instancel Run the gtar command to back up files.

    In the current directory, back up all the files and folders in /export/home/sybdev to thedefault device. During the backup, the file information is displayed.# gtar cv /export/home/sybdevIn the current directory, back up all the files and folders in /export/home/sybdev and savethem as databak.tar. During the backup, the file information is displayed.# gtar cvf databak.tar /export/home/sybdev

    l Run the gtar command to restore files.Restore the files of default devices in the backup files to a hard disk. During the restoration,the file information is displayed.# gtar xvIn the current directory, decompress the backup file databak.tar to /export/home/sybdev. During the restoration, the file information is displayed.# gtar xvf databak.tar

    CAUTIONl There is no - symbol before the function option and modification option of gtar.l The gtar command can pack multiple files. The command is as follows:

    # gtar cvf filebak.tar file1 file2 file3l This command packs the three files, that is, file1, file2, and file3, into the file named

    filebak.tar.l Under different UNIX systems, when using gtar to back up or restore files, note that names

    of the floppy disk and tape are different. Ensure that you use the right names.

    compress CommandThis describes the function, format, and example of the compress command.

    FunctionThe compress command is used to compress files and save the memory space. The name of thecompressed files ends with .Z. The command for decompressing such files is uncompress.

    Command Formatcompress file

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-23

  • ExampleTo compress a file, run the following command:# compress file

    CAUTIONThe difference between the tar command and the file compressing commands is as follows:The tar command packs or combines files and packs many folders or files into a package. Tocompress the combined files *.tar, use the compress or pack command.

    uncompress CommandThis describes the function, format, and example of uncompress command.

    FunctionThe uncompress command is used to decompress the compressed files. The command forcompressing files is compress.

    Command Formatuncompress compressed file ending with ".Z"

    ExampleTo decompress the file.Z file, run the following command:# uncompress file.Z

    pack CommandThis describes the function, format, and example of the pack command. The pack command isused to compress files and save memory space.

    FunctionRun the pack command to compress files. The name of the compressed files ends with .Z. Thespace achieved through compression depends on file types. To extract files, use the unpackcommand.

    Command Formatpack file

    ExampleTo pack a file, run the following command:# pack file

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-24 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • CAUTIONl Do not run the pack command to compress files of small sizes. To compress such files, use

    the pack command with the option -f for forced compression.# pack -f filename

    l The difference between the tar command and the file compression commands is as follows:The tar command packs or combines files and packs many folders or files into a package.To compress the combined files *.tar, use the compress or pack command.

    unpack CommandThis describes the function, format, and example of the unpack command.

    FunctionThe unpack command is used to extract the packed files. To pack files, use the pack command.

    Command Formatunpack compressed file ending with ".Z"

    ExampleTo extract the file.Z file, run the following command:# unpack file.Z

    pkgadd CommandThis describes the function, format, option, and example of the pkgadd command.

    FunctionThe pkgadd command is used to send a file package to the system for execution. To remove apackage from the system, run the pkgrm command.

    Command Formatpkgadd option file package name

    Option Description-d device: to install or copy a package from the device. The device can be an absolute path, theidentifier of a tape, or a disk such as /var/tmp or /floppy/floppy_name, or a device name suchas /floppy/floppy0.

    ExampleTo send a file package in the current folder to the file1 file, run the following command:# pkgadd -d . file1

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-25

  • The dot in the command indicates that the folder is the current folder.

    pkgrm CommandThis describes the function, format, and example of the pkgrm command.

    FunctionThe pkgrm command is used to remove a package from the system. To pack and send a packageto the system, use the pkgadd command.

    Command Formatpkgrm option file package name

    ExampleTo remove the file1 file, run the following command:# pkgrm file1

    16.3.3 Commands for Viewing UNIX Text FilesThis describes the commands used for viewing UNIX text files, their functions, along withexamples.

    16.3.3.1 echo CommandThis describes the function, format, option, and example of the echo command.16.3.3.2 cat CommandThis describes the function, format, option, and example of the cat command.16.3.3.3 more CommandThis describes the function, format, option, and example of the more command. The morecommand is used to view a file one screen at a time.16.3.3.4 head CommandThis describes the function, format, and example of the head command.16.3.3.5 tail CommandThis describes the function, format, and example of the tail command.16.3.3.6 clear CommandThis describes the function and example of the clear command.16.3.3.7 grep CommandThis describes the function, format, and example of the grep command.16.3.3.8 vi CommandThis describes the function and format of the vi command. The vi command can be used to createand modify text files.

    echo CommandThis describes the function, format, option, and example of the echo command.

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-26 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • FunctionThe echo command is used to send a character string to a standard output device such as themonitor screen.

    Command Formatecho character string option

    Option DescriptionTable 16-8 lists five options that are frequently used.

    Table 16-8 Option description of the echo commandOption Description\c The RETURN character is not displayed.\0n n is an 8-digit ASCII character code.\t The TAB character is displayed.\n The RETURN character is displayed.\v The vertical TAB character is displayed.

    Example# echo $HOME/export/home/sybase

    /export/home/sybase displayed on the screen is the meaning of the character string "$HOME".To prevent the system from displaying RETURN, run the following command:# echo $HOME "\c"/export/home/sybase

    Or:# echo "$HOME \c"/export/home/sybase

    NOTE

    The options \c, \0n, \t, \n, and \v are displayed in the character string enclosed in quotation marks. Thequotation marks can quote either one option or multiple options.

    cat CommandThis describes the function, format, option, and example of the cat command.

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-27

  • FunctionThe cat command is used to view the contents of a text file.

    Command Formatcat option file

    Option Descriptionl -n: number of each line of the displayed textl -v: to view nonprinting characters rather than TAB and RETURN

    ExampleTo view the contents of the cat_Table.txt file, run the following command:# cat cat_Table.txtName Owner Object_type ------------------------------ ------------------------------ ---------------------- tbl128Addr cat user table tbl128IP cat user table tbl128Name cat user table tblAdapterIP cat user table tblAdjCell cat user table... ... ...

    NOTE

    To view several files at the same time, run the following command:# cat file1 file2 file3

    more CommandThis describes the function, format, option, and example of the more command. The morecommand is used to view a file one screen at a time.

    FunctionView a file one screen at a time. You can also use this command to browse the previous screensand to search for character strings.

    Command Formatmore option file

    Option DescriptionRemember to insert the prefix - before the options when multiple options and combination ofoptions are used. Table 16-9 lists four options that are frequently used.

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-28 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • Table 16-9 Option description of the more commandOption Description-c Clears the screen before the content is displayed.-w Indicates that the system does not exit at the end of the input but waits for the

    prompt.-lines Displays the number of lines on each screen.+/mode Searches files in a preset mode.

    ExampleTo view the contents of the cat_Table.txt file on screen at a time, run the following command:# more cat_Table.txtName Owner Object_type ------------------------------ ------------------------------ ---------------------- tbl128Addr cat user table tbl128IP cat user table tbl128Name cat user table tblAdapterIP cat user table tblAdjCell cat user table... ... ...

    NOTE

    l To view a file on screen at a time, press the following keys to perform relevant operations:Space key: to view the next screenReturn key: to view the next lineq: to exith: to view the online helpb: to switch back to the previous screen/word: to search the character string "word" backward

    l Due to the consecutive execution of multiple UNIX commands, |more can be added at the end ofother commands to view the relevant results on several screens.

    head CommandThis describes the function, format, and example of the head command.

    FunctionThe head command is used to view the first few lines of a text file. By default, the first 10 linesare displayed.

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-29

  • Command Formathead value file

    ExampleTo view the first three lines of the M2000 _Table.txt file, run the following command:# head -3 M2000 _Table.txt Name Owner Object_type ------------------------------ ------------------------------

    tail CommandThis describes the function, format, and example of the tail command.

    FunctionThe tail command is used to view the last few lines of a text. By default, the last 10 lines aredisplayed.

    Command Formattail value file

    ExampleTo view the last three lines of the cat_Table.txt file, run the following command:# tail cat_Table.txtName Owner Object_type ------------------------------ ------------------------------ ---------------------- tbl128Addr cat user table tbl128IP cat user table tbl128Name cat user table tblAdapterIP cat user table tblAdjCell cat user table... ... ...

    NOTE

    A special function of the tail command is to view the latest changes of a log file, because all the latestchanges are added at the end of the log file. The command format is as follows:# tail -f commdrv.logThe option -f refers to the function of monitoring a file.

    clear CommandThis describes the function and example of the clear command.

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-30 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • FunctionThe clear command is used to clear the contents on the screen.

    ExampleTo clear the screen, run the following command:# clear

    grep CommandThis describes the function, format, and example of the grep command.

    FunctionThe grep command is used to search for a character string in a text file and to print all the linesthat contain the character string.

    Command Formatgrep character string file

    ExampleTo search the character string operation in the ifconfig.txt file, run the following command:# grep operation ifconfig.txt used to control operation of dhcpagent(1M), the DHCP client operation, be used to modify the address or characteristics dhcpagent wakes up to conduct another DHCP operation on the given, and the operation is one that requested operation will continue.

    To search the character string "The following options are supported" in the ifconfig.txt file, runthe following the command:# grep "The following options are supported" ifconfig.txt The following options are supported:

    NOTE

    The character string "The following options are supported" includes spaces. Remember to enclose thecharacter string within quotation marks in the command line.

    vi CommandThis describes the function and format of the vi command. The vi command can be used to createand modify text files.

    FunctionAs a powerful text editing tool, the vi editor is used to create and modify text files.The vi editor works in two modes:

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-31

  • l Text input mode: to enter the textl Command mode: to enter the control command

    Formatl To start the vi editor, enter the following command:

    vi file namel Table 16-10 lists the operations in the text input mode.

    Table 16-10 Operations in the text input modeCommand Functiona Insert text immediately after the cursor (append).A Insert text at the end of the line where the cursor is.i Insert text immediately before the cursor (insert).I Insert text before the first nonblank character in the line where the

    cursor is.o Insert a new line below the current one and insert text (open).O Insert a new line above the current one and insert text.

    l Table 16-11 lists the operations related to moving the cursor in the text input mode.

    Table 16-11 Operations related to moving the cursor in the text input modeCommand Functionh Move the cursor one character left.j Move the cursor one character down.k Move the cursor one character up.l Move the cursor one character right.Line No. G Move the cursor to a specified line. For example, 1G means

    that the cursor is moved to the first line.G Move the cursor to the end of the text.

    l Table 16-12 lists the operation for exiting the text input mode and switching to the

    command mode.

    Table 16-12 Operation for exiting the text input mode and switching to the command modeCommand FunctionESC Exit the text input mode and switches to the command mode.

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-32 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • l Table 16-13 lists the operations related to deleting characters in the command mode.

    Table 16-13 Operations related to deleting characters in the command modeCommand Functionx Delete a character.dd Delete a line.

    l Exit the vi editor.

    All the commands that exit vi editor must be run in the command mode. Therefore pressESC before running the commands. Table 16-14 describes the commands for exiting thevi editor.

    Table 16-14 Commands for exiting the vi editorCommand Function:wq Save a file and exit the vi editor.:q Exit from the vi editor without saving the file.:q! Exit from the vi editor and discard all the changes.:w Save a file other than exit the vi editor.

    16.3.4 Commands for Managing UNIX UsersThis describes the user management commands that are frequently used in the UNIX system.This also describes the functions of these commands and gives some examples. Only user rootand the authorized users can add, modify, or delete users and user groups.

    16.3.4.1 useradd CommandThis describes the command function, command format, command option, and example of theuseradd command.16.3.4.2 userdel CommandThis describes the function, format, and example of the userdel command.16.3.4.3 usermod CommandThis describes the function, format, parameter, and example of the usermod command.16.3.4.4 passwd CommandThis describes the function, format, and example of the passwd command.16.3.4.5 groupadd CommandThis describes the function, format, and example of the groupadd command.16.3.4.6 groupdel CommandThis describes the function, format, and example of the groupdel command.16.3.4.7 groupmod CommandThis describes the function, format, parameter, and example of the groupmod command.

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-33

  • useradd CommandThis describes the command function, command format, command option, and example of theuseradd command.

    FunctionThe useradd command is performed to add a user in the UNIX system.

    Command Formatuseradd option new user name

    Option DescriptionYou can combine options of the useradd command. Add the prefix - before these options. Table16-15 lists the common options.

    Table 16-15 Option description of the useradd commandOption Remark-c comment Indicate the comment.-d directory Indicate the home folder.-m Indicate the automatic creation of a home

    folder if the home folder does not exist.-g group Indicate the user group that the user belongs

    to.-s shell Indicate the shell that the user uses.

    ExampleCreate a user named omc1 in the UNIX system. The user omc1 belongs to the staff user groupand the home folder is /home1/omc that is created automatically. In addition, the comment isTest User and B shell is applied. To create a user named omc1 in the UNIX system, run thefollowing commands:# useradd -c "Test User" -d /home1/omc -m -g staff -s /usr/bin/sh omc1

    CAUTIONAfter a user is added, set the password for the added user. For details of setting the password,refer to 16.3.4.4 passwd Command. After the password is set, the user can log in as a new user.

    userdel CommandThis describes the function, format, and example of the userdel command.

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-34 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • FunctionThe userdel command is used to delete a user. Some UNIX systems do not allow deleting userscompletely. Run the userdel command to revoke the privileges granted to the user.

    Command Formatuserdel user name

    ExampleAssume that there is user omc1 in the system. To delete user omc1, run the following command:# userdel omc1

    CAUTIONWhen a user has logged in, do not run the userdel command to delete the user. If you run theuserdel command, the following error message is displayed:UX: userdel: ERROR: omc1 is in use. Cannot remove it.

    usermod CommandThis describes the function, format, parameter, and example of the usermod command.

    FunctionThe usermod command is used to modify the user login information.

    Command Formatusermod option user name

    Option DescriptionThe combined option of the usermod command can be used. Add the prefix - before the options.Table 16-16 lists the common options.

    Table 16-16 Option description of the usermod commandOption Description-c comment Modified comment-d directory Modified home folder-m Create a home folder automatically if the

    home folder does not exist-g group Modified user group

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-35

  • Option Description-s shell Used shell-l new_logname Modified user name

    ExampleTo modify the login information about omc1, you need modify the user name to test, user groupto new_group, home folder to /home1, and comment to Tester. Run the following command:# usermod -c "Test User" -d /home1 -g new_group -l test omc1

    CAUTIONDo not run the usermod command to modify a user when the user has logged in. If you use theusermod command, the following error message is displayed:UX: usermod: ERROR: omc1 is in use. Cannot change it.

    passwd CommandThis describes the function, format, and example of the passwd command.

    FunctionThe passwd command is used to set a password for an added user or to change the user password.

    Command Formatpasswd user name

    ExampleAssume that the user omc1 is added. To set the password of omc1, run the following command:# passwd omc1New Password:Re-enter new Password:passwd: password successfully changed for omc1

    NOTEThe input password is not displayed.

    groupadd CommandThis describes the function, format, and example of the groupadd command.

    FunctionThe groupadd command is used to add a user group in the UNIX system.

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-36 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • Command Formatgroupadd user group name

    ExampleTo add the user group staff1 in the UNIX system, run the following command:# groupadd staff1

    groupdel CommandThis describes the function, format, and example of the groupdel command.

    FunctionThe groupdel command is used to delete a user group in the UNIX system.

    Command Formatgroupdel user group name

    ExampleTo delete the user group staff1, run the following command:# groupdel staff1

    groupmod CommandThis describes the function, format, parameter, and example of the groupmod command.

    FunctionThe groupmod command is used to modify the information about a user group.

    Command Formatgroupmod user group name

    Parameter Description-n name: the name of the modified user group

    ExampleTo modify the name of the user group staff1 to staff2, run the following command:# groupmod -n staff2 staff1

    16.3.5 Commands for Managing UNIX System ResourcesThis describes the commands for managing UNIX system resources. This also describes thefunctions of these commands and gives some examples.

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-37

  • 16.3.5.1 prstat CommandThis describes how to use the CPU to check the function and user identity of the prstat command.It also provides an example to explain the application.16.3.5.2 man CommandThis describes the function, format, and example of the man command.16.3.5.3 df CommandThis describes the function, format, option, and example of the df command.16.3.5.4 du CommandThis describes the function, format, option, and example of the du command.16.3.5.5 ps CommandThis describes the function, format, option, and example of the ps command.16.3.5.6 kill CommandThis describes the function, format, option, and example of the kill command.16.3.5.7 who CommandThis describes the functions, command format, option description, parameter description, andexample of the who command.16.3.5.8 whereis CommandThis describes the function, format, option, parameter, and example of the whereis command.The whereis command is used to view the location of a source file, binary file, and online helpof a command.16.3.5.9 which CommandThis describes the function, format, and example of which command.16.3.5.10 hostname CommandThis describes the function, format, and example of the hostname command.16.3.5.11 uname CommandThis describes the function, format, parameter options, and application examples of the unamecommand.16.3.5.12 ifconfig CommandThis describes the function, format, option, and example of the ifconfig command.16.3.5.13 script CommandThis describes the function, format, parameter options, and application examples of the scriptcommand. You use this command to record all the screen input and output in a script file. Youmust start recording the screen input and output after running the script command and endrecording them after running the exit command.16.3.5.14 date CommandThis describes the function, format, parameter options, and application examples of the datacommand. The data command is used to view the current date and time of the system.16.3.5.15 bc CommandThis describes the function and example of the bc command.16.3.5.16 prtconf CommandThis describes the function, format, parameter options, and instances of the prtconf command.

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-38 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • prstat CommandThis describes how to use the CPU to check the function and user identity of the prstat command.It also provides an example to explain the application.

    FunctionThe CPU usage may be high when a large number of NE alarms are reported in a short period.This command is used to find out the cause of these alarms.

    Permitted UsersUsers root, omcuser, and dbuser are authorized to run the prstat command.

    Example-bash-3.00$ prstatThe command result contains the CPU usage of each process.

    man CommandThis describes the function, format, and example of the man command.

    FunctionThe man command is used to view the online help about a command.

    Command Formatman option command

    ExampleTo view the online help about the pwd command, run the following command:# man pwdReformatting page. Wait... done

    User Commands pwd(1)

    NAME pwd - return working directory name

    SYNOPSIS /usr/bin/pwd

    DESCRIPTION pwd writes an absolute path name of the current working directory to standard output.

    Both the Bourne shell, sh(1), and the Korn shell, ksh(1), also have a built-in pwd command.

    ENVIRONMENT See environ(5) for descriptions of the following environment variables that affect the execution of pwd: LC_MESSAGES and NLSPATH.

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-39

  • EXIT STATUS--More--(30%)

    NOTE

    Not all parameters in the man command are command names. For example, the man ascii commanddisplays all the ASCII characters and their expressions. The man shell_builtins command displays thebuilt-in command list and the shell using the commands.

    df CommandThis describes the function, format, option, and example of the df command.

    FunctionThe df command is used to view the free disk space. The system administrator runs this commandfrequently to check the usage of the disk space to avoid disk failure due to data overflow.

    Command Formatdf option file system

    Option Descriptionl -l : the local file systeml -k: to view the free disk space (unit: KB)

    ExampleTo check the free disk space, run the following command:# df -kFilesystem kbytes used avail capacity Mounted on/dev/dsk/c0t0d0s0 2053605 997684 994313 51% //proc 0 0 0 0% /procfd 0 0 0 0% /dev/fd/dev/dsk/c0t1d0s7 35009161 2562019 32097051 8% /export/homeswap 3431792 6664 3425128 1% /tmp

    The command result contains the following information:l File system namel File size (unit: KB)l Used spacel Free spacel Capacity percentage of the filled file system and the mounting pointWhen you run the df command without any parameters, the free disk space in each mounteddevice is displayed.When the free disk space is reduced to the bottom line, the system administrator must takeimmediate measures to locate the faulty file system.

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-40 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • du CommandThis describes the function, format, option, and example of the du command.

    FunctionThe du command is used to view the disk space used by a specific folder or file.

    Command Formatdu option folder or file

    Option Descriptionl -a : to view the disk space used by each filel -s: to view the used total disk spacel -k: to view the result (unit: KB)

    Examplel To view the disk space used by the files in the /export/home/sybase folder, run the

    following command:# du -k /export/home/sybase |more212554 /export/home/sybase/bin7 /export/home/sybase/charsets/ascii_876 /export/home/sybase/charsets/cp437124 /export/home/sybase/charsets/cp850214 /export/home/sybase/charsets/deckanji237 /export/home/sybase/charsets/eucgb235 /export/home/sybase/charsets/eucjis142 /export/home/sybase/charsets/iso_113 /export/home/sybase/charsets/mac78 /export/home/sybase/charsets/roman8221 /export/home/sybase/charsets/sjis1119 /export/home/sybase/charsets/unicode1383 /export/home/sybase/charsets/utf83850 /export/home/sybase/charsets76 /export/home/sybase/collate/unicode77 /export/home/sybase/collate97 /export/home/sybase/config87484 /export/home/sybase/devlib1921 /export/home/sybase/diag/bin3 /export/home/sybase/diag/custom37 /export/home/sybase/diag/formdefs225 /export/home/sybase/diag/locales/us_english--More

    l To view the disk space used by all file systems in the current folder and send the results tothe sort command for sorting, run the following command:# du -s * |sort -rn |more425108 bin174968 devlib41094 lib18588 pad9406 locales7700 charsets6810 scripts5552 install4636 diag4404 upgrade

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-41

  • 1220 sample834 symlib718 include194 sybhelp194 config154 collate76 init50 license14 xappdefaults12 sybserver.cfg12 sybserver.bak12 sybserver.083--More

    l To list the first three file systems according to the file size, run the following command:# du -s * |sort -rn |head -10425108 bin174968 devlib41094 lib18588 pad9406 locales7700 charsets6810 scripts5552 install4636 diag4404 upgrade

    ps CommandThis describes the function, format, option, and example of the ps command.

    FunctionThe ps command is used to view the status of the processes currently running in the system..

    Command Formatps option

    Option Descriptionl -e : to view the status of all the processes that are running in the systeml -l: to view the running processes in a long-form listl -u user: to view the process status of a specific userl -f : to view all the status information about the processes that are running in the system

    Examplel To view the status of all the running processes controlled by the login device (the terminal),

    run the following command:# ps PID TTY TIME CMD 13726 pts/5 0:00 ksh

    l To view the complete information about the active processes, run the following command:# ps -f UID PID PPID C STIME TTY TIME CMD sybase 13726 13724 0 08:44:35 pts/5 0:00 -ksh

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-42 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • l To view the M2000 processes, run the following command:# ps -ef | grep imap root 22344 1 0 17:49:43 ? 0:03 imapsvcd -name devdoc_agent -sysagent DEFAULTSYSAGENT -port 31105 -agentid 0 root 22374 1 0 17:49:48 ? 0:02 imapsvcd -name am_agent -sysagent DEFAULTSYSAGENT -port 31131 -agentid 0 root 22346 1 0 17:49:43 ? 0:01 imapsvcd -name em_agent -sysagent DEFAULTSYSAGENT -port 31002 -agentid 0 root 22342 1 0 17:49:43 ? 0:11 imapsvcd -name cmdc_agent -sysagent DEFAULTSYSAGENT -port 31103 -agentid 0 root 22355 1 0 17:49:45 ? 0:11 imapsvcd -name ifms_agent -sysagent DEFAULTSYSAGENT -port 31011 -agentid 119 root 22338 1 0 17:49:42 ? 0:02 imapsvcd -name 3gpp_agent -sy......

    NOTE

    l After you run the ps command without any parameters, the screen displays information about allrunning processes that are controlled by the login device (terminal).

    l After you specify the -f parameter, more information is displayed. The information includes the username (UID), process ID (PID), parent process ID (PPID), technical number that indicates therunning time of the process (C), process start time (STIME), name of the terminal that activates theprocess (TTY), and the process name (CMD). If TTY displays ?, infer that this process is not associatedwith the terminal.

    l To view all the processes related to specific characters, for example, the process related to theM2000, run the grep command with the ps command.

    kill CommandThis describes the function, format, option, and example of the kill command.

    FunctionThe kill command is used to terminate a process.

    Command Formatkill option process No.

    Option Descriptionl -l : lists the names of all the signalsl -s signal: sends a signal named signal to the processes

    Parameter DescriptionProcess No.: the ID of the process to be terminated, that is, the process ID

    Examplel To list all the signal names, run the following command:

    # kill -l

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-43

  • EXIT HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM USR1 USR2 CLD PWR WINCH URG POLL STOP TSTP CONT TTIN TTOU VTALRM PROF XCPU XFSZ WAITING LWP FREEZE THAW CANCEL LOST RTMIN RTMIN+1 RTMIN+2 RTMIN+3 RTMAX-3 RTMAX-2 RTMAX-1 RTMAX

    l To terminate the process with PID as 256, run the following command:# kill -s KILL 256

    NOTE

    l The previous signal names can be expressed by code.For example, -1 for HUP, -2 for INT, -3 for QUIT, -9 for KILL, -15 for TERM. The signalKILL can be replaced with -9.This signal is the most frequently used one in the kill command, and thus it has the highest priority.The default signal 15 is used when no option is specified for the kill command. Run the followingcommand to terminate the process with the PID as 256:# kill -9 256

    l Run the ps command to check the execution of the kill command by listing the PIDs of the terminatedprocesses.

    l The kill command may lead to a data loss. Run this command with care.

    who CommandThis describes the functions, command format, option description, parameter description, andexample of the who command.

    FunctionThe who command reports the login information about all the users in the current system.

    Command Formatwho Option

    Option Descriptionl -b : display the system date and time of the last startupl -m: display the related information about the users who run the command (the same as the

    command who with two parameters am i

    Parameter Descriptionam i: display the login information about the users who run the command

    Examplel Display the login information about all the users in the current system:

    # whoroot pts/3 Feb 4 10:08 (10.129.16.60)sybase pts/5 Feb 4 08:45 (10.129.28.44)root pts/6 Feb 4 11:25 (10.129.16.60)

    l Display the login information about the users who run the command:# who am i

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-44 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • sybase pts/5 Feb 4 08:45 (10.129.28.44)

    or:# who -msybase pts/5 Feb 4 08:45 (10.129.28.44)

    whereis CommandThis describes the function, format, option, parameter, and example of the whereis command.The whereis command is used to view the location of a source file, binary file, and online helpof a command.

    FunctionThe whereis command is used to view the location of a source file, binary file, and online helpof a command.

    Command Formatwhereis option command

    Option Descriptionl -b : to view the location of the binary filel -m: to view the location of the help manuall -s: to view the location of the source file

    Parameter Descriptioncommand: the command for which the location is to be displayed

    Examplel To view the exact location of files of various versions for the ls command, run the following

    command:# whereis lsls: /usr/bin/ls /usr/ucb/ls /usr/man/man1/ls.1 /usr/man/man1b/ls.1b

    l To view the exact location of the binary file for the ls command, run the followingcommand:# whereis -b lsls: /usr/bin/ls /usr/ucb/ls

    l To view the exact location of the help manual for the ls command, run the followingcommand:# whereis -m lsls: /usr/man/man1/ls.1 /usr/man/man1b/ls.1b

    which CommandThis describes the function, format, and example of which command.

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-45

  • FunctionThe which command is used to view the location where a command is run. The result may bean absolute path or alias of the command found in the user environment variant PATH.

    Command Formatwhich command

    ExampleTo view the position where the commands pwd, who, and which are run, run the followingcommand:# which pwd who which/usr/bin/pwd/usr/bin/who/usr/bin/which

    NOTE

    If the command to be located does not exist in the file, the following error messages are displayed afteryou run the which command:# which qqqqno qqqq in /usr/bin /usr/ucb /etc /export/home/sybase/bin /export/home/sybase/install.

    hostname CommandThis describes the function, format, and example of the hostname command.

    FunctionThe hostname command is used to view or set the host name.

    Command Formathostname host name

    ExampleTo view the host name, run the following command:# hostname

    NOTE

    If you run the hostname command without parameters, the host name of the equipment is displayed. Ifyou run the hostname command with parameters, the host name is set. Only the super user can run thehostname command.

    uname CommandThis describes the function, format, parameter options, and application examples of the unamecommand.

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-46 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • FunctionThe uname command is used to view the information about the operating system. If you run thiscommand without parameters, only the name of the operating system is displayed. If you runthis command with parameters, more details about the operating system are displayed.

    Formatuname option

    Option DescriptionThe options of the uname command can be combined. Add the prefix - before the options. Table16-17 lists some frequently used options.

    Table 16-17 Description of the uname optionsOption Description-a Views all the information.-i Views hardware information.-m Views the name of the equipment hardware.

    It is recommended that -p be used instead of-m.

    -n Views the name of the network equipment.-p Views the ISA of the host or the type of the

    processor.-r Views the serial number of the operating

    system of the host.-s Views the name of the operating system of the

    host (it is the default option).-v Views the version of the operating system of

    the host.-S system_name Sets the host name of the machine.

    ExampleTo view the name, version, and serial number of the operating system on the host, run thefollowing command:# uname -svr

    ifconfig CommandThis describes the function, format, option, and example of the ifconfig command.

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-47

  • FunctionThe ifconfig command is used to view the IP address of the host.

    Command Formatifconfig option

    Option Description-a: to view all the address information

    ExampleTo view the IP address of the host, run the following command:# ifconfig -alo0: flags=849 mtu 8232inet 127.0.0.1 netmask ff000000hme0: flags=863mtu 1500 inet 129.9.169.143 netmask ffff0000 broadcast 129.9.255.255hme0:1:flags=863 mtu 1500 inet 129.6.253.136 netmask ffff0000 broadcast 129.6.255.255

    NOTE

    In the previous output, the IP address of the displayed host is 129.9.169.143, and the logical IP address is129.6.253.136. In the UNIX system, a network adapter can bind several logical IP addresses, which realizescommunications between different network segments.

    script CommandThis describes the function, format, parameter options, and application examples of the scriptcommand. You use this command to record all the screen input and output in a script file. Youmust start recording the screen input and output after running the script command and endrecording them after running the exit command.

    CAUTIONClose the script file before running the exit command to terminate the recording of the screenI/O. If you do not close the script file, the script file builds up and hinders the normal operationof the system.

    FunctionRecord in a script file all the screen input and output that occur from the time when the scriptcommand is run to the time when the exit command is entered. The script command is helpfulfor programming and debugging.

    Formatscript option file

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-48 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • Option Description-a: appends the screen I/O content to a file. If you do not set this parameter, the screen I/Ooverwrites the content of the file.

    Parameter Descriptionfile: the file used to save the screen I/O content. If you do not specify the file name, the screenI/O content is saved to the typescript file.

    ExampleTo save the screen I/O content in the default destination file typescript, run the followingcommands:# scriptScript started, file is typescript

    # ps PID TTY TIME CMD 775 pts/8 0:00 ksh

    # pwd/export/home/sybase

    # dateMon Feb 4 19:12:14 GMT 2002

    # exitScript done, file is typescript

    To view the content of the typescript file, run the following command:# cat typescriptScript started on Mon Feb 04 19:11:49 2002$ ps PID TTY TIME CMD 775 pts/8 0:00 ksh$ pwd/export/home/sybase$ dateMon Feb 4 19:12:14 GMT 2002$ exitscript done on Mon Feb 04 19:12:24 2002

    date CommandThis describes the function, format, parameter options, and application examples of the datacommand. The data command is used to view the current date and time of the system.

    FunctionThe data command is used to view the current date and time of the system. The super user canrun the date command to set the system date and time.

    M2000HA System Administrator Guide (S10) 16 M2000 Command Reference (HA)

    Issue 06 (2008-03-18) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    16-49

  • Formatdate option +format

    Option Descriptionl -a: to use the Greenwich mean time.l +format: to specify the command output format.Table 16-18 describes the format of the command output.

    Table 16-18 Format of the command outputFormat Description%h Abbreviation of the month: from January to December%j A day in a year: from 001 to 366%n Switch to next line%t The tab key%y The last two digits of the year: from 00 to 99%D Output format of the date: month/date/year%H Hour: from 00 to 23%M Minute: from 00 to 59%S Second: from 00 to 59%T Output format of time: hour:minute:second

    Examplel To view the current date and time of the system, run the following command:

    dateMon Feb 4 20:26:16 GMT 2002

    l To view the current system date and time in the Greenwich Mean Time, run the followingcommand:date -uMon Feb 4 12:27:26 GMT 2002

    l To view the current date of the system in the format of month/day/year, run the followingcommand:date +%D02/04/02

    bc CommandThis describes the function and example of the bc command.

    16 M2000 Command Reference (HA)M2000

    HA System Administrator Guide (S10)

    16-50 Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd

    Issue 06 (2008-03-18)

  • FunctionThe bc command is used to perform a simple calculation.

    ExampleTo multiply 4 by 5, run the following command:# bc4*520

    NOTETo get the result, run the bc command, and then press Enter. Type the formula 4*5, and then pressEnter. The result is displayed on the screen. Press Ctrl+D to exit from the bc program.

    prtconf CommandThis describes the function, format, parameter options, and instances of the prtconf command.

    FunctionThe prtconf command is used to check the system configuration information.

    Formatprtconf option device path

    Instancel Check all the configuration information about the system.

    # prtconfSystem Configuration: Sun Microsystems sun4uMemory size: 4096 MegabytesSystem Peripherals (Software Nodes):

    SUNW,Netra-240 scsi_vhci, instance #0 packages (driver not attached) SUNW,builtin-drivers (dri