Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Check what the hp minicomputer commands are.

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "View hp minicomputer commands", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "View hp minicomputer commands what are" this article.

1. Model

# model

9000/800/L2000-44

Note: where 44 means that each cpu has a 440MHZ.

2. Number of cpu

# top

CPU LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS

0 0.02 0. 0% 0. 0% 0. 0% 0. 0% 0. 0% 0. 0%.

1 0.00 0.6% 0. 0% 0. 0% 0. 0% 0. 0% 0. 0%

2 0.00 2.0% 97.0% 0.00% 0.00% 0.00%

3 0.00 0.4% 0.0% 0.06% 99.6% 0.00% 0.00% 0.00%

3. Size information of the hard disk

# diskinfo / dev/rdsk/c1t0d0

SCSI describe of c1t0d0:

Vendor: SEAGATE

Product id: ST39204LC

Type: direct access

Size: 8891556 Kbytes

Bytes per sector: 512

4. The number of hard drives

# ioscan-funC disk

Disk 0 0/0/1/1.0.0 sdisk CLAIMED DEVICE SEAGATE ST39204LC

/ dev/dsk/c1t0d0 / dev/rdsk/c1t0d0

Disk 1 0/0/1/1.2.0 sdisk CLAIMED DEVICE SEAGATE ST39204LC

/ dev/dsk/c1t2d0 / dev/rdsk/c1t2d0

Disk 20 / 0/2/0.0.0 sdisk CLAIMED DEVICE SEAGATE ST39204LC

/ dev/dsk/c2t0d0 / dev/rdsk/c2t0d0

Disk 3 0/0/2/0.2.0 sdisk CLAIMED DEVICE SEAGATE ST39204LC

/ dev/dsk/c2t2d0 / dev/rdsk/c2t2d0

Disk 4 0/0/2/1.2.0 sdisk CLAIMED DEVICE HP DVD-ROM 305

/ dev/dsk/c3t2d0 / dev/rdsk/c3t2d0

Disk 5 0/4/0/0.8.0 sdisk CLAIMED DEVICE SEAGATE ST39236LC

/ dev/dsk/c4t8d0 / dev/rdsk/c4t8d0

5. Check the operating system version and license

# uname-a

HP-UX scp1 B.11.00 U 9000/800 1124961527 unlimited-user license

6. How to view memory

# dmesg

Memory Information:

Physical page size = 4096 bytes, logical page size = 4096 bytes

Physical: 2097152 Kbytes, lockable: 1866308 Kbytes, available: 1902728 Kbyts

7. How to view the file system

# bdf

Filesystem kbytes used avail used Mounted on

/ dev/vg00/lvol3 1025617 24790 898265 3%

/ dev/vg00/lvol1 700691 35482 595139 6 / stand

/ dev/vg00/lvol8 2097152 436927 1557195 22% / var

/ dev/vg00/lvol7 1048576 481524 531631 48% / usr

/ dev/vg00/lvol6 255253 148 229579 / tmp

/ dev/vg01/lv_tellin 2051553 127152 1719245 7% / tellin

/ dev/vg00/lvol5 2097152 81783 1889462 4% / opt

/ dev/vg01/lv_informix 2051553 413823 1432574 22% / opt/informix

/ dev/vg00/lvol4 524288 1229 490375 / home

There are two files: / etc/fstab / etc/mnttab

8. View the volume group, the logical volumes included in the volume group, and the physical disks included in the volume group

# vgdisplay-v vg00

The results are all displayed in the order of logical volume groups, logical volumes, and physical disks.

9. View the location of volume groups and logical volumes

# cd / dev/

There are all logical volume groups under this directory, and then enter a logical volume group, and you will see all its logical volumes.

10. Activate / deactivate volume groups

# vgchange-a y volume group name (activation)

# vgchange-an volume group name (deactivated)

11. A series of commands for creating volume groups, logical volumes, and file systems

Formatting

# pvcreate / dev/rdsk/c0t1d0 (here it is assumed that the file name of the device with block disk is c0t1d0)

Create volume group name

# mkdir / dev/vglock

Name of the device file that created the volume group

# mknod / dev/vglock/group c 64 0x010000 (note here that group cannot be repeated)

Create a volume group

# vgcreate / dev/vglock / dev/dsk/c0t1d0 (add physical disk c0t1d0 to the volume group)

Activate volume group

# vgchange-a y / dev/vglock

Create logical volume lv_informix

# lvcreate-n lv_informix / dev/vglock

Increase the size of a logical volume

# lvextend-l 50 / dev/vglock/lv_informix (unit is page, page size is created again

The volume group has been determined and cannot be changed. The default is generally 4m, so it is 200m)

Or

# lvextend-L 200 / dev/vglock/lv_informix (this is an uppercase L parameter that indicates

The size is allocated in M units.)

If you also want to change the volume group to a file system, create the file system as follows

# newfs-F hfs / dev/vglock/rlv_informix

Create a directory to which the file system is mounted

# mkdir / informix

Attach the file system

# mount / dev/vglock/lv_informix / informix

12. Delete volume groups, logical volumes

Delete logical Volum

# lvremove / dev/vglock/lv_informix

Deactivate the volume group

# vgchange-a / dev/vglock (if you cannot deactivate it, you can force it with the following command

Activate, vgchange-c n / dev/vglock)

Pre-delete volume group

# vgexport-p-s-m / tmp/vglock.map / dev/vglock

Delete volume group

# vgexport-s-m / tmp/vglock.map / dev/vglock

Create a shared volume group

Deactivate it on a machine that has already created a volume group

# vgchange-an / dev/vglock

Pre-delete volume group

# vgexport-p-s-m / tmp/vglock.map / dev/vglock

Transfer the map file to another machine

# rcp scp1:/tmp/vglock.map scp2:/tmp/vglock.map

Create a volume group name before importing a volume group on another machine

# mkdir / dev/vglock

Create a group node file

# mkno / dev/vglock/group c 64 0x010000 (this node must be the same as the first machine)

Import volume group

# vgimport-s-m / tmp/vglock.map / dev/vglock

14. Collection of versions of informix

# su-informix

Informix >; onstat-

So you can see the version of informix.

15. Dual machine maintenance command

Run the following command on one machine to pull up the cluster daemons of both nodes first

And then automatically pull up the application.

Cmruncl

Or run the dual daemon on the host first, and then join the standby node

Then set the application to run on a node, then the specified node should be the host.

Cmruncl-n scp1

Cmrunnode scp2

Cmrunpkg-n scp1-v scp_service

Check the status of both computers

Cmviewcl-v

Cmviewcl

Cmquerycl

Cmviewconf

Dual-computer switching

Method 1: you can stop the host

Cmhaltnode scp1

Method 2: you can switch applications manually

Cmhaltpkg-n scp1-v scp_service (stop the application scp_service from the scp1 machine)

Or

Su-tellin

Stellin >; kill_scp.sh

Or

Su-informix

Informix >; onmode-kuy

To change the host switched node back into a switchable node, you must run the following command

Cmmodepkg e-n scp1-v scp_service (use scp_service to switch back to next time

Scp1 node)

Sometimes, in order to diagnose the standby, the standby is set to a node that cannot run the application, such as

Cmmodepkg d-n scp1-v scp_service (application scp_ cannot be run on node scp1

Service)

16. Location of configuration files for dual computers

# cd / etc/cmcluster/ (configuration file cmcluster.asc for dual daemons)

# cd / etc/cmcluster/scppkg/ (application profile scppkg.asc,control.sh for dual computers

Scppkg.sh, one of these three files is used to develop a dual-computer floating IP)

17. Location of dual-machine maintenance commands

# cd / usr/sbin/ (you can see all the execution commands about dual computers with ls cm*)

18. Configuration of dual computers

"" configure cmcluster.asc

Check the validity of the cmcluster.asc profile

# cmcheckconf-v-C cmcluster.asc

If the configuration is incorrect, there will be an error prompt and correct it according to the error prompt.

Do not apply the profile until it is correct

# cmapplyconf-f-v-C cmcluster.asc

If you feel that the configuration needs to be changed again after application, you can delete the configuration file

# cmdeleteconf-v-c scp1

# cmdeleteconf-v-c scp2

"" configure the application file scppkg.asc,control.sh,scppkg.sh

Check the validity of the three files

# cmcheckconf-v-P scppkg.asc

If the configuration is incorrect, there will be an error prompt and correct it according to the error prompt.

Do not apply the profile until it is correct

# cmapplyconf-f-v-C scppkg.asc

If you feel that the configuration needs to be changed again after application, you can delete the configuration file

# cmdeleteconf-v-c scp1

# cmdeleteconf-v-c scp2

Note: the deletion referred to here is only used when you need to diagnose dual computers on a stand-alone machine.

Otherwise, you don't have to be so responsible, you just need to reapply it, the original

It doesn't matter whether you delete it or not.

18. Configuration of the network

First of all, the network cable must be connected correctly.

When configuring the network card for the minicomputer, you must first make sure that the driver of the network card has already

Installed, check with the following command.

# lanscan

If the status of both the active Nic and the attached Nic you see is up, it means

All the network cards are available. And at this time, you must know which card is used as a data network card.

This network card should have been determined when installing the HP-UX operating system, such as

Lan0 is selected as the active data network card, and the address of the network card is generally installed.

HP-UX has also shown its device path, such as: 0Unix, 1Universe, 10Uniplet0, etc.

Or you can see its path with the lanscan command. After instruction, you should connect the network cable directly.

From the net buckle, connect to the active HUB.

Then the other two are backup network cards, and the location of them can also be determined according to the path of the device.

If you are sure, you can use one of the cards to cross the network cable and use the same network port as the other machine

Connected, used to make a heartbeat.

Then another additional network card should not be configured with an address. We use it as a backup network card.

Use a directly connected network cable to connect to the backup HUB from this port, which can be used as a heartbeat network card

The backup network card can also be used as a backup network card for the data network card.

On the HPL2000 series machines, we can also see that there is a network buckle on the data network card.

The port is used as a console port, and a console line can be connected to it to configure the machine.

"" configure the IP address again

# vi / etc/rc.config.d/netconf

Below this file are the names of all network cards, iP addresses of network cards, gateways, and configuration of subnet masks.

This configuration can take effect for a long time in the future, and the next time the machine is restarted, it will be based on the configuration text.

To automatically configure the network.

Or

# ifconfig lan0 133.64.48.91 255.255.255.192

# ifconfig lan1 129.9.168.120 255.255.255.192

"" check the address of the network card

# lanscan lan0

# lanscan lan1

Lan2 does not configure an address.

Common Diagnostic tools for Network Card

Ping

Lanscan; to see if the status of the network card is "up".

Linkloop; (when using this command, be sure to use lanscan to find out the physical address of the network card.

Because the parameter followed by this command is the physical address of the network card, you can simply determine the network cable and hub.

Is there a problem)

Subnetmask should be consistent in the same network.

19. When configuring dual-computer cmcluster.asc, you should determine the subnet in which the IP address of the network card is located.

You can view it by coming down to

# netstat-in (you can see the address of the network card, subnet corresponding to the IP address, gateway, default route,

Whether there is a floating network card, whether the host computer)

20. Configure routing information

Method 1: you can add it by modifying the / etc/rc.confg.d/netconf file, and the next time you start it

It will take effect.

Method 2: you can use the command line to set:

/ usr/sbin/route add default 20.08.28.98 1

21. View routing information

# netstat-an

22. Configure remote maintenance

How to determine whether remote maintenance has been configured? remote maintenance is configured through hardware

As long as the serial port maintained remotely is not damaged, even if you reinstall it, on the front panel of the minicomputer

The remote light will be yellow, and the yellow light will always be double, indicating that the serial port can be maintained remotely.

But we still need to configure remote maintenance through GSP.

Configuration of remote port of minicomputer

Ctrl + b

Enter

Enter

GSP >; ca

A dialog box appears, and if you want to modify a parameter, you can modify it through the dialog box.

The usual values are:

Bitrate: 9600

Flow control: software

Terminal type:vt100

Modem protocol:CCITT

Modem bit rate:9600

Flow control: hardware

Mode transmit configuration:disable

Mode presence:always connected

Configuration on modem

AT&F

ATS0=1

AT&WO&Y0

Save exit.

Note: HP generally provides a special omni-directional modem, called "Skycurtain Crossing Boat".

Modem must be connected to the line port.

23. A super command.

# set_parms

The parameters that follow it can be as follows

Date_time: setter time

Ip_address: set the address of the network card

Hostname: setting hostnam

Addl_netwrk: sets the gateway of the host.

24. Addition of users and user groups

Method 1: use the useradd and groupadd commands to add

Method 2: modify the files / etc/passwd and / etc/group files to achieve.

25. A useful tool is sam

Various operations can be performed through sam, such as the management of users and user groups, the management of logical volume groups and logical volumes, and the management of kernel parameters.

26. A useful diagnostic tool mstm

It can be used to collect all the hardware information, such as what memory sockets there are.

How big is each existing memory bar, you can also check several memory bars and other information.

Examples of use:

# mstm

Select system () and select Tools/information/information log on the menu

You can see a lot of information about hardware, such as:

System Information for (scp1)

HPUX Model Number.: L2000 / / Machine model is HP L2000

HPUX Model String.: 9000/800/L2000-44

Original Product Number: A5191A

Current Product Number.:

System Serial Number...: (Unknown)

Hversion.: 0x5c40

Sversion.: 0x491

Software Capabilities..: 0x100000f0

PD CPU Information:

Number of CPUs in the current Protection Domain = 2 / / two cpu

Cabinet 0; Cell 0; CPU Map

Cpu

Slot | 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 |

State | a | |

C-Configured (CPU powered on)

D-De-configured (CPU powered off)

A-Active (configured and processes running)

Select memory and select Tools/information/information log on the menu

You can see information about memory, such as:

Information Tool Log for MEMORY on path 8--

Log creation time: Wed Jul 3 17:05:47 2002

Hardware path: 8

Basic Memory Description

Module Type: MEMORY

Total Configured Memory: 1024 MB / / you can see the total memory, which is 1G.

Page Size: 4096 Bytes

Memory interleaving is supported on this machine and is ON.

Memory Board Inventory

DIMM Slot Size (MB)

--

0a 256 / / you can see whether a memory stick has been inserted in each memory slot, and

How much memory is the memory bar? for example, 256m is inserted into the 0a slot here.

1a 256

0b 256

1b 256

-- / / it can be seen that all four memory slots of the minicomputer are full.

System Total (MB): 1024

Memory Error Log Summary

The memory error log is empty.

Page Deallocation Table (PDT)

PDT Entries Used: 0

PDT Entries Free: 50

PDT Total Size: 50

When using mstm, you can open another terminal window and execute the command # / usr/sbin/ioscan-fn, so that you can know each device

The hardware address information of the

In this way, the results are as follows:

Lan 2 0/7/0/0 btlan6 CLAIMED INTERFACE HP A3738A PCI 10/100Base-TX Ultimate Combo

/ dev/diag/lan2 / dev/ether2 / dev/lan2

Memory 0 8 memory CLAIMED MEMORY Memory

Processor 0 160 processor CLAIMED PROCESSOR Processor

Processor 1 166 processor CLAIMED PROCESSOR Processor

In this way, you can know that the address 020000 corresponds to a 100m network card, and then go to the mstm window to check its information log

Information, so that you can clearly understand the hardware information.

Disk usage information can also be found in the collection results file, such as:

I hqqpw Path Driver Sasha W State Description = 0 sdisk CLAIMED HP 0 sdisk CLAIMED HP C5447A 60 State Description = = 0 0 sdisk CLAIMED HP C5447A 8 0 prime 0 0 sdisk CLAIMED HP C5447A 8 0 max 3 UniGap 0.0.3 sdisk CLAIMED HP C5447A 100 max 0. 0 sdisk CLAIMED HP C5447A 100 0.4 sdisk CLAIMED HP C5447A 12 0/3/0/0.0.5 sdisk CLAIMED HP C5447A 3 0/6/0/0.1.0 sdisk CLAIMED HP C5447A 5 0/6/0/0.1.1 sdisk CLAIMED HP C5447A 7 0/6/0/0.1.2 sdisk CLAIMED HP C5447A 9 0/6/0/0.1.3 sdisk CLAIMED HP C5447A 11 0/6/0/0.1.4 sdisk CLAIMED HP C5447A 13 0/6/0/0.1.5 sdisk CLAIMED HP C5447A Device H _ c1t2d0 W Path Product id Size Physical Alternate (Mbytes) Volume Link = c1t2d0 0 ST39204LC 8683 yes bootable no c3t2d0 0, a c4t0d0 0, 0.0.0 C5447A 1024 yes no c4t0d1 0, 0.0.1 C5447A 2052 yes no c4t0d2 0, a c4t0d4 0, 0.0.2 C5447A, 10252 yes no c4t0d3 0, 0.0.3 C5447A, 1024 no n, c4t0d4 0. / 3/0/0.0.4 C5447A 2052 no n/a c4t0d5 0/3/0/0.0.5 C5447A 10252 no n/a c5t1d0 0/6/0/0.1.0 C5447A 1024 yes yes c5t1d1 0/6/0/0.1.1 C5447A 2052 yes yes c5t1d2 0/6/0/0.1.2 C5447A 10252 yes yes c5t1d3 0/6/0/0.1.3 C5447A 1024 no n/a c5t1d4 0/6/0/0.1.4 C5447A 2052 no n/a c5t1d5 0 / 6/0/0.1.5 C5447A 10252 no n/a Note: All disk devices are listed here Not only hard disks.LVM mirroring software** LVM mirroring software MirrorDisk/UX (B2491A) is NOT installed.... .. * * Part 2: VOLUME GROUPS**Volume Group: / dev/vg00* Physical Volumes: / dev/dsk/c1t2d0 Volume group disk space usage: Total: 8676 Mbytes 2169 PE Allocated: 8404 Mbytes 2101 PE Free: 272 Mbytes 68 PE PE size: 4 MbytesVolume Group: / dev/vg10** * Physical Volumes: / dev/dsk/c4t0d0 / dev/dsk/c5t1d0 Alternate Link Volume group disk space usage: Total: 1020 Mbytes 255PE Allocated: 0 Mbytes 0 PE Free: 1020 Mbytes 255PE PE size: 4 MbytesVolume Group: / dev/vg12* Physical Volumes: / dev/dsk/c4t0d2 / dev/dsk/c5t1d2 Alternate Link Volume group disk space usage: Total: 10248 Mbytes 2562 PE Allocated: 10076 Mbytes 2519 PE Free: 172 Mbytes 43 PE PE size: 4 Mbytes

Note: the utility of the collection tool is to obtain programs that cannot be executed in shell, such as executing:

Ioscan-fn

Mstm

Cstm

Sam

Wait.

27. Restart the machine

# reboot

# shutdown

28. Turn off the machine

# shutdown-hy 0

# init 0

28. The centralized operation mode of unix

Multi-user mode, but 6 user modes and so on.

You can see how it works with the following command:

# who-r

29. Ordinary conversation

# wall "hello!" (broadcast the news of hello)

# banner "hello!" (enlarge the hello message)

# banner "hello!" | more (magnify the hello message and then broadcast it)

30. Look at the current login

# logname

31. Look at all logged-in users

# who

32. See what the logged-in user is doing

# whodo

33. Look at the progress

Ps-ef | grep root (look at the process of the root user. Sometimes if the process executed on the console cannot be stopped, then kill the console process because it is the parent of another process.)

34. Setting of webconsole

Configuration and maintenance of HP Secure Web Console

HP's Secure Web Console provides a more convenient way for system administrators to access Console based on Web. The system administrator only needs to launch a web browser on any PC that can ping Web Console and enter the IP of Web Console to get the interface of the server Console.

To configure Web Console, follow these steps:

1) initialize Web Console:

1 / connect Web Console to the local network. Its preset IP address is 192.0.0.192.

2 / on your PC, run the following command:

Route add 192.0.0.192 Local_IP_address

3 / make sure you can ping 192.0.0.192.

4 / run a web browser on PC and type URL: http://192.0.0.192 to get the Web Console configuration menu. Follow the menu prompts to enter the Admin Account username and password and change its IP to the local network IP address (make sure the IP is not duplicated) and the subnet mask.

2) use Web Console

1 / use the serial port line of ordinary Console, one terminal is connected to the server Local Console port, the other is connected to the serial port of Web Console.

2 / on the browser of PC, enter the current IP address of Web Console. Enter its LOGIN window, enter the Admin Account user name and password created during configuration, enter the server Console interface, click Access Console with the mouse, and the black Console window appears on the right side of the screen; click In/Out to enlarge the Console window.

35. Location of the demo process

The files in / etc/rc3.d/ can pull up the process when the system starts up.

36. Use of magnetic tapes

Write:

Tar cvf / dev/rmt/0m / temp/t.sql / / back up the t.sql files under the temp directory to tape 0m

Read:

Tar tvf / dev/rmt/0m / / read out the contents of tape 0m

Untangle the tar file from the tape:

Tar xvf / dev/rmt/0m/aa.tar. / / unlock the aa.tar file on the tape to the current directory

When starting the machine with magnetic tape, we can enter the startup path by hitting any key when starting.

Type SEA (search) to search for the boot path, and then you can find the tape path, for example, the tape path is

Path 5, enter po 5 to boot from the tape.

37. Installation of HP-UX

=

Installation of HP-UX dual-computer system

1) install the HP-UX operating system on the two hosts, note: about / on the two hosts

File systems such as / stand,/var,/home,/usr,/opt,/swap,/dev must be of the same size

2) install patch (the following operations are the same on both hosts)

# mkdir cdrom / / create a directory where DVD is to be mounted

# ioscan-kfnCdisk / / View the hardware description file of DVD for the following pre-installation hooking

_ use CD identified as support plus _

A) Select the CD identified as support plus in the package and insert it into the DVD drive

# mount / dev/dsk/c3t2d0 / cdrom / / attach the DVD file system to the / cdrom directory

# cd / cdrom

# ls / / browse the CD and find two patch directories, XSWHWCR1100 and XSWGR1100

# swinstall-s / cdrom/XSWHWCR1100 / / so go to sam to install, select XSWHWCR1100 on the CD, and use the submenu Install under the menu item Action in sam to install.

Note: after installing the patch of XSWHWCR1100, the machine will automatically reboot to recreate the new kernel

B) after the machine starts again, we can install another patch named XSWGR1100 on this CD of the same support plus.

# mount / dev/dsk/c3t2d0 / cdrom

# swinstall-s / cdrom/XSWGR1100

Note: the same system restarts automatically after the patch is installed

_ use 3 of 4 Application Software CD _

C) Select the CD identified as 3 of 4 Application Software in the package to insert into the DVD drive

# mount / dev/dsk/c3t2d0 / cdrom

# swinstall-s / cdrom / / Select "Ignite-UX-11-00 B.2.5.136 HP-UX Installation Utilities for Installing after entering sam

11.00 System 97186 HP-UX-B.11.00-32 amp 4 "this patch to install

Note: the same system restarts automatically after the patch is installed

_ use 4 of 4 Application Software CD _

D) Select the CD identified as 4 of 4 Application Software in the package to insert into the DVD drive

# mount / dev/dsk/c3t2d0 / cdrom

# swinstall-s / cdrom / / after entering sam, select ".11.09 MC/ServiceGuard installation" atch to\ install MC/ServiceGuard

Note: the same system will restart automatically after the patch is installed

_ use 1 of 4 Application Software CD _

E) Select the CD identified as 1 of 4 Application Software in the package and insert it into the DVD drive

# mount / dev/dsk/c3t2d0 / cdrom

# swinstall-s / cdrom / / Select? 3230A B.11.00 100Base-T PCI after entering sam? And

11.00 HP-UX Unlimited-User License "reef" atch to install.

/ / the former patch is used to install the driver for the additional network card, and only when it is installed, the standby network card and heartbeat network card are available in the system, because these two blocks

The network card is attached to the system, and the matching driver must be installed. 53230A represents the model of the additional network card, which can be installed from the carton.

According to the list, the active network card that comes with the system itself has been automatically configured when the operating system is installed, so there is no need for us to reconfigure it manually.

Before the patch is installed, you can only see one active network card with the command: # lanscan

After installing the patch, you can use the command: # lanscan to see three network cards.

/ / the latter patch is used to install unlimited license.

=

38. What should I do if I forget my password

Restart the machine

Press any key during startup and you will enter a main menu

Use SEArch to search for the startup path

Restart the machine with the serial number of the bo + path

Select Y when Interactive with IPL (Y or N)? >; appears

Then you are asked to enter the path of the booted kernel, hp_ux 0 (indicating booting to system maintenance mode)

Then after the startup is complete, you can passwd root to change the password.

39. How to make a full backup of a root file system

# make_recovery-Av

40. How to use the optical drive

# ioscan-funC disk

Find the path to the CD, such as / dev/dsk/c3t2d0

# mkdir / cdrom

# mount / dev/dsk/c3t2d0 / cdrom

# cd / cdrom

Just do it.

After using it, exit the directory to the root directory, and then use the

Umount / cdrom to release the disc, you can take it out.

If you want to boot from the CD, restart the machine, and click any key to enter SEA, and then use po to determine the path of the CD to boot with the CD.

41. Install several types of compressed files of informix from the optical drive

1) tar xvf / cdrom/IDS.tar; (compressed files are of type TAR)

2) cpio-icvdBum

< /cdrom/IDS.CPI (压缩文件是CPI类型的) 42、双机配置必须两台机器都要配置的文件 /etc/hosts /etc/services /.rhosts /etc/cmcluster/* 43、如何查看当前的网络子网、网络的掩码是多少 1)查看子网 #netstat -in 查看lan0对应的: Name Mtu Net/Dest Address Ipkts Ierrs Opkts Oerrs Collis Queue lan0 1500 172.0.8.0 172.0.8.68 3430395 0 1134355 0 0 0 可知子网就是172.0.8.0 2)查看掩码 查看/etc/rc3.d/netconfig.d/netconf文件中的netmasks字段就知道了。 44、如何创建数据库的DR 主机:ontape -s -L 0 onmode -d primary online2_net(备机的网络数据库) 备机:ontape -p onmode -d secondary online1_net(主机的网络数据库) 45、HP-UX的文件系统 / :根目录,以下的目录全部是子目录 /etc :主要存放配置文件 /usr :主要存放一般用户都可以执行的命令 /var :主要存放unix核心 /usr/sbin :主要是存放系统维护命令 /usr/bin :主要是存放普通用户可以执行的命令 /home :主要是作为普通用户的主目录 /opt :主要是安装除了unix系统之外的应用程序 /swap :交换区 /temp :临时文件存放目录 46、如何在安装完HP-UX的OS操作系统之后,来打双机的patch呢? #swinstall -s /cdrom/XSWHWCR1100 //先打CR #swinstall -s /cdrom/XSWGR1100 //再打GR 再来安装第一张盘中的各个卡的驱动程序,以及安装unix用户的不受限制的协议 备注:安装完成以后用命令swlist |grep 来查看有没有成功安装某个patch, 如果觉得某个patch安装是错误的,不需要安装的话,那么可以用命令 swremove -s 来进行删除。 47、如何安装cmcluster双机软件呢 一般都在软件包中的第4张盘,并且一定要找到license这张纸,上面又codeword,一定要输入codeword才能够看到该软件。 如果该纸已经丢失了,那么可以从机器面板上找到序列号后再来网站http://www.license.hp.com上去找。 48、日志文件的查询 /var/adm/syslog/syslog.log //系统常用信息,如配置、修改、启动、关闭等信息 /var/adm/syslog/mail.log //电子邮件信息 /var/adm/syslog/swinstall.log //软件安装产生的信息 /var/adm/syslog/swremove.log //软件卸载产生的信息 /var/adm/sulog //执行su的情况 /var/adm/btmp //所有注册失败信息 /var/adm/vtmp //所有注册信息 查看日志主要是查看关键字panic、warning、err等信息,如: cat /var/adm/syslog/syslog.log |grep panic cat /var/adm/syslog/syslog.log |grep warning cat /var/adm/syslog/syslog.log |grep err 49、如何配置系统的互相信任关系 在用户的主目录下面生成.rhosts文件, 如在smp01/smp02上的.rhosts文件中都输入: smp01 root smp02 root 50、如何从备份的磁带来恢复数据库informix呢 1)备份数据库(informix用户) informix>

; ontape-s-L 0

2) restore the database of another machine from the backed-up tape

Informix >; ontape-p

51. Commands for activating and deactivating network cards of HP

# ifconfig lan0 up / / activate the Nic lan0

# ifconfig lan0 down / / deactivate the Nic lan0

Note: the general method to eliminate network card errors is: ping / ifconfig up | down / linkloop

52. Detailed notes on HP L2000 (for scp) dual computer configuration

Install the operating system, determine the host name, determine the password of root, determine the size of /, / usr, / var, etc., select

The active network card, and give the active network card an IP address

Patch CR, patch GR

Install the drivers of the other two additional network cards, and you can see that all three network cards are up with ifconfig.

Connect the active network cards of both machines to the active HUB with a direct connection.

Assign an IP address to one of the additional network cards. This Ip address and the Ip address of the active network card are addresses in two network segments, and cross lines are used.

Connect this additional network card of the main and standby machine as a heartbeat cable.

In addition, the remaining network card does not need to be given an IP address, it is a backup network card for the active network card and heartbeat network card, and it does not need to give the IP address

Its replacement relationship is specified in the dual-computer configuration file cmcluster.asc. When the active and heartbeat network card is damaged, it will

To replace them and get their Ip address

Finally, install the cmluster dual-computer software, which is installed using swinstall-s / cdrom, but must be installed before installation

For data codeword, you will not see the package until you enter the correct codeword, and the codeword is obtained according to the

Get it from the random paper, or from the http://www.license.hp.com website, and enter the directory / usr/sbin after installation.

Check if there are files such as cmruncl/cmdeleteconf/cmapplyconf/cmhaltcl/cmrunnode/cmhaltnode.

Create a lock disk logical volume group

Create other logical volume groups, logical volumes

Install the database

Install the tellin application

Copy the dual configuration file to the / etc/cmluster/ directory for configuration and application

Start the database

Start the application

Start the dual computer

53. Detailed notes on HP N4000 (for sdp) dual computer configuration

After installing the operating system, just like hp L2000

Install a series of packages and install the FC60 package

Divide the disks in the three sc10 disk cabinets on FC60 into physical volume groups LUN, such as LUN0/LUN1/LUN2/LUN3, etc.

Create lock disk logical volume groups and other logical volume groups on LUN, on the first machine, and from vgimport to the second machine

Activate other logical volume groups on one of the

Install the database

Then stop the database.

Activate a machine on which logical volumes are grouped

Activate logical volume groups on the second machine

Install the database file system on the second machine

Copy onconfig, sqlhosts, .rhosts, services, etc. Files from the first machine to the second machine

Start the database directly by oninit on the second machine

Configure the dual configuration file under the / etc/cmcluster/ directory

Add the logical IP corresponding to the logical machine in / etc/hosts

Change the machine name of the sqlhosts file in the database to the name of the logical machine or to the floating IP address

Deactivate all logical volume groups

Start the dual computer

Check whether the switch between the two computers is normal.

54. About the locking disc

1) the meaning of the locking disc

The locking disk is set for determining the active and standby relationship in the event of some special failure of the dual-computer system, so each node must have the right to access the locking disk under normal circumstances, so it is also recommended

Users should not use this disk to serve other applications. To prevent lock disc failure, the lock disc can be configured with more than one piece, which is the same as in the case of a single block, except in the configuration file

It is necessary to explain all the locking plates used in the. In the configuration file cmcluster.asc file description.

2) the physical disk of the locking disk

The physical disk of the lock disk must have two scasi disk interfaces and both hosts must be connected. Installed in a shared disk cabinet. The locking disk is necessary for a dual-computer system and must be in the form of a shared disk.

3) creation of logical volume group of locking disk

In the TELLIN-SCP dual-computer system, no user data is placed in the lock disk, so there is no need to partition logical volumes. If the user wants to use this disk space

It can be divided according to its own requirements without affecting the normal operation of the SCP machine, and there is no additional requirement for the double machine.

Execute on the first machine:

Pvcreate / dev/rdsk/c0t2d0

Vgcreate / dev/vglock / dev/dsk/c0t2d0

Vgchange-a y / dev/vglock

Vgdisplay / / see if you can see that the disk volume group vglock is active.

Vgchange-an / dev/vglock

Vgdeport-m-s / tmp/vglock.map / dev/vglock / / transfer the creation information of vglock volume groups to a map file everywhere

Execute on the second machine:

Rcp scp1:/tmp/vglock.map scp2:/tmp/vglock.map

Mkdir / dev/vglock

Mknod / dev/vglock/group c 64 0x010000

Vgimport-m-m / tmp/vglock.map / dev/vglock

Vgdisplay

Vgchange-a y / dev/vglock

4) the locking disc is in the state of heavy running on both machines.

The lock disc should be deactivated on both machines before it starts. Even if the machine starts, the lock disc is also deactivated.

55. About the disks used by dual-computer cluster and the disks used by applying package, the number of disks used by cmclustar.asc is more than the number of disks used by package.

56. Maintenance command set of FC60 disk enclosure

57. How to start the scp system

Start the standby database

Oninit

Start the Arctic database

Oninit

Start the host application

Manager

Start the Arctic application

Manager

Start dual computers on the host

Mcruncl

58. How to start sdp system

Because sdp is usually in the form of a shared disk cabinet, you only need to run cluster with the shared disk on one machine:

Cmruncl

It activates all the required logical volume groups such as informix and sdp, mounts the file system, and then starts cluster.

59. How to recover the database when the master / slave of the database is inconsistent with the cluster?

1) the active database runs on scp1, while the active application runs on the second machine. At this time, the application can only be stopped, then the database will be stopped, and both machines will be stopped.

2) then delete the configuration file of the dual computer and delete it with the command cmdeleteconf. Then generate the configuration file, using the command cmapplyconf-C cmcluster.asc

-P. / scppkg/scppkg.asc; then starts the active database and changes it to standard state, and then makes a database level 0 on this machine.

Backup, and then take the tape to the second machine to restore the database, re-establish the DR relationship, we can apply it, and then pull up the dual machines.

At this point, the application of the database and the dual computer should be the same.

60. Parameters that must be modified after the hp small machine has installed the operating system for the first time.

For example, database parameters cannot be initialized without modification.

61. How to create a system backup of rootdg (backup everything under the rootdg)

=

1) back up on a good machine

# make_recovery-Av / / backs up everything under the vg00 volume group, such as /, / stand, / var, / swap

Wait, the backup is on the tape, and the next time the system is damaged, you can use the tape to boot and restore the system.

1) if the tape backed up by make_recovery is restored, the process is as follows:

-non-interactive recovery system

[1] in the tape drive, insert the system recovery tape

Boot system

[3] interrupt the Boot process and enter Boot_admin >; prompt

[4] Boot_admin >; bo 8amp 16.0.0

8According 16.0.0: hardware path of tape drive

[5] choose non-interactive?

[6] wait for the system to be restored

-Interactive recovery system

[1] in the tape drive, insert the system recovery tape

Boot system

[3] interrupt the Boot process and enter Boot_admin >; prompt

[4] Boot_admin >; bo 8amp 16.0.0

8According 16.0.0: hardware path of tape drive

[5] unselect? non-interactive? [6] Select

a. [Install HP-UX]

B. [] Advanced Installation

c. Configure or change the following options:

Disks, file systems

Hostname, IP ddress

Timezone, root password

DNS server, and gateway

[7] Select [install continue?] until the system is restored.

=

62. How to change the terminal type of HP's console terminal

A. enter the default configuration state

Now power off the console.

Control + d

Then turn on the power without loosening the left hand.

Knowing that there is a prompt that "you have entered the default setting", release your left hand, and then hit enter to enter the default mode.

B. Enter the configuration state

Hold down F8 first.

Press and hold F10 again

Then use the space space bar to select and modify. Generally, the terminal type is selected as HP, but sometimes vt100 is selected.

Press the Esc exit key to save and exit after modification, and that's fine.

63. Modification of other parameters of console

If we classify the fault phones of our diagnostic users, a considerable part of the problem lies in the setting of Console. The common phenomenon is that there is no system display on the Console, or the keyboard is locked and so on. Users often think that it is the problem of the host, but it is not. Let's give a brief introduction:

The default configuration for the minicomputer console to function properly is:

REMOTE MODE ON (with * sign)

MEMORY LOCK OFF (without * sign)

LINE MODIFY OFF (without * sign)

MODIFY ALL OFF (without * sign)

BLOCK MODE OFF (without * sign)

You can view the above configuration as follows:

There is a row of function keys F1-F8 above the keyboard of the minicomputer console, and there are Menu and User System keys between the function keys F4 and F5. When you want to view the parameter configuration of the minicomputer console, first press the User system key, then the bottom line of the minicomputer console screen shows 8 high-brightness squares, each box corresponds to function keys F1 to F8 from left to right; then press the function key F4, indicating that you choose Modes, which is still 8 bright squares, but the text on the box has changed. Check the corresponding boxes according to the names of the above five parameters to see if they are configured correctly. If not, press the function key corresponding to the box to change until all the parameters are configured correctly. Finally press the menu key to exit. In addition, here is a quick way to resolve Console failures:

1) turn off Console power

2) hold down the CTL+ D key, turn on the Console power supply until you hear the "flute" sound, release the button.

3) wait a moment, the word "Default configs used, Press enter clear" will appear in the lower left corner of the screen, and everything will return to normal after pressing enter.

4) if the Remote Mode of the F4 key position does not have a * number, press F4 plus *

The above is essentially to restore the default settings of Console.

64. What should I do if I forget the password of HP?

Restart the machine to the maintenance mode, change the mode and then enter the multi-user mode to ok:

1) restart. After the self-test is completed, the line "To discontinue, press any key in 10 seconds" appears.

Press any button at this time, the system terminates and starts, and enters Main Menu. "

2) Type "bo" and ask "Interact with IPL" in the system. Enter "y" when.

3) at the prompt ISL >;, enter "hpux-is" to enter the single-user state (that is, maintenance mode)

4) change the password with passwd

5) switch to the multi-user state, use the command init 3, and the system returns to normal.

65. HP: disk management software LOGIC VOLUMN MANAGER, referred to as LVM

Its user and read and write permissions to modify the volume group are implemented with chown and chmod in hpux.

Add:

Initialize the physical disk: pvcreate-f / dev/rdsk/c1t1d0

Create a volume group: mkdir / dev/vglock

Mknod / dev/vglock/group c 64 0x0001

Vgcreate / dev/vglock / dev/dsk/c1t1d0

View volume group activation information: vgdisplay / dev/vglock

Activation volume group: vgchange-a-y / dev/vglock (force activation with vgchange-c-y / dev/vglock)

Deactivate volume group: vgchange-an / dev/vglock (use vgchange-c n / dev/vglock to force deactivation)

Create a logical volume: lvcreate-L 500-n lv_root / dev/vglock (- L is the specified size in M)

Lvcreate-l 250 / dev/vglock (- l refers to the number of pages, page unit 4m)

Create a file system: newfs-F hfs / dev/vglock/rlv_root

Mkdir / informix

Mount / dev/vglock/lv_root / informix

Extended logical volume: lvextend-l 50 / dev/vglock/lv_root (in pages, page size is recreated

The volume group has been determined and cannot be changed. The default is generally 4m, so it is 200m.)

Or

Lvextend-L 200 / dev/vglock/lv_informix (this is the uppercase L parameter, indicating

The size is allocated in M units.)

Extended file system: umount / informix

Extendfs / dev/vglock/lv_root

If it is a vxfs file system, use the

Extendfs-F vxfs / dev/vg00/lvol4)

Mount / dev/vglock/lv_root / informix

Export logical volume group: vgexport-p-v-m / tmp/lock.map / dev/vglock

(export information for vglock logical volume groups)

Delete logical volume group: vgexport-v-m / tmp/lock.map / dev/vglock (delete logical volume group vglock)

Import this logical volume group into another set of minicomputers:

Rcp scpn1:/tmp/lock.map scpn2:/tmp/lock.map

In the node scpn2, create the lockdisk volume group directory name (take the same directory name as the scpn1 node)

Command: # mkdir / dev/vglock

On the scpn2 node, create a control file name group for the lock disc

Command: # mknod / dev/vglock/group c 64 0x0001

The last parameter oxhh0000 should be guaranteed to be unique in the scpn2 node, if possible

Its parameter settings are the same as the scpn1 node. To ensure uniqueness, you can check existing volume groups by using the following command:

On the scpn2 node, map the lock disc configuration from the file back to the system

Command: # vgimport-s-m / tmp/lock.map / dev/vglock

66. Use fbackup & frecover to flexibly back up all mounted file systems or specify a file system, can also be used to restore the entire file system, can also be flexible to restore a specified file system, more flexible than make_recovery-Av, and these two commands restore only in single-user mode, while the make_recovery command needs to restart the tape boot to restore the entire rootdg.

Remarks: the difference from make_recovery

Make_recovery is mainly used to back up the contents of rootdg and users to restore the operating system; fbackup & frecover is mainly used to back up all mounted file system files in all logical volume groups

A, system backup command: fbackup

1) the common methods of fbackup:

[1] enter a single user:

# init-s or

# shutdown 0

[2] system full backup

# fbackup-f / dev/rmt/0m-0iv /-I / tmp/sysbk.index

-f: device file name (such as DDS tape driver)

-I: the directory to be included

-e: directories that are not included

-I: backup content retrieval directory

-v: detailed list of backup contents

-0: level zero backup

# fbackup-f / dev/rmt/0m-I /-e / home

Back up all directories except the directory / home

[3] description

A. This command backs up the file system of the current mounted of the system.

B, backup level description

There are 9 backup levels. If the current system uses level zero backup, when the next level 5 backup is used, only the files that have changes will be backed up.

2) the second common way of fbackup:

[1] # mkdir-p / tmp/fbackupfiles/index

# mkdir-p / tmp/fbackupfiles/log

[2] # touch/tmp/fbackupfiles/index/ full.`date'+% y% m% d.% HVA% M'`

[3] enter a single user

# shutdown-y 0

[4] make a full backup of the system

# fbackup-0vi /-f / dev/rmt/0m\

-I / tmp/fbackupfiles/index/ full.`date'+% y% m% d.% HRV% M``\

2 >; / tmp/fbackupfiles/log/ full.`date'+% y% m% d.% HVA% M'`

[5] description

In this way, you can know the time it takes to back up the system.

3) three common ways of fbackup:

[1] enter a single user

# shutdown-y 0

[2] make a full backup of the system

# fbackup-0uv /-f / dev/rmt/0m\

-g / tmp/fbackupfiles/mygraph\

-I / tmp/fbackupfiles/index/ full.`date'+% y% m% d.% HRV% M``\

2 >; / tmp/fbackupfiles/log/ full.`date'+% y% m% d.% HVA% M'`

[3] description

A. File mygraph: contains the directory to be backed up in the following format:

/ users/data

/ home/app

E/ oracle/sql

B, parameter u:

When the backup system is successful, the system will update / var/adm/fbackupfiles/dates.

4) four common ways of fbackup:

Back up the remote system

[1] when logging in to the local system

# remsh backup_sysname "fbackup-f DDS_sysname: / dev/rmt/0m-0vi /"

[2] when logging in to a remote system

# fbackup-fbackup _ sysname: / dev/rmt/0m-0vi /

5) the common ways of fbackup:

Compressed backup (not recommended, affecting system performance)

[1] compressed backup

# fbackup-0vi / dir-f-| compress | dd of=/dev/rmt/0m obs=10k

"-": point to standard output

[2] View backup content

# dd if=/dev/rmt/0m ibs=10k | uncompress | frecover-I-f-

B, system recovery command: frecover

1) restore everything on the tape drive:

[1] enter a single user:

# init-s or shutdown 0

[2] recover data

# frecover-rf / dev/rmt/0m

Recover all data on tape

-f: device file name

-r: recover all data on tape

-I: save the file index on tape to the specified file

# frecover-I / tmp/index.txt-f / dev/rmt/0m

2) restore a directory:

# frecover-xi / directory

# frecover-x-I / dir1-I / dir2

# frecover-xoi / dir

-o: overwrite existing files with the same name under / dir

# frecover-xvXi / dir

-X: restore data by directory on tape

# cd / tmp/local; frecover-xvYi / dir

-Y: restore data by file name on tape

For example:

# cd / tmp/local

# frecover-xvF-I / home/filename

[recovery result] / tmp/local/filename is not / home/filename

3) restore data from the remote tape drive to the local:

# frecover-xi / dir-f remote_name: / dev/rmt/0m

4) recover data from the local tape drive to the remote system:

# remsh remote_name "frecover-xi / dir-f local_name:

/ dev/rmt/0m "

67. Modify the startup characteristics of HP dual-computer system

HP and SUN models usually use the following two methods: HP model: modify the configuration file: / etc/rc.config.d/cmcluster set it to the following content: AUTOSTART_CMCLD=1.

When the SCP dual-computer system is started on the host, it is not allowed to automatically start CLUSTER and the PKG on it. You need to edit the / etc/rc.config.d/cmcluster file to make: AUTOSTART_CMCLD=0

68. Configuration of node access rights when HP is configured with dual computers.

Access permissions settin

Before you configure CLUSTER and PKG, configure or modify access security files so that each node has access to another node.

The permissions are set as follows:

Edit (or create) the cmclnodelist file located in the / etc/cmcluster directory with root privileges to contain the following:

Scp1 root

Scp2 root

Scp1 tellin

Scp2 tellin

.rhosts

Edit the .rhosts file in the root (/) directory with root privileges to contain the following:

Scp1 root

Scp2 root

Scp1 tellin

Scp2 tellin

Hosts.equiv

Add the following:

Scp1 root

Scp2 root

Scp1 tellin

Scp2 tellin

69. Relationship between memory and cpu in HP minicomputer

One cpu is generally configured with a maximum of 0.5 GB of memory, and two cpu are configured with 1 GB of memory.

70. Swapinfo to check the usage and size of the exchange area.

Scp1:/hptmp # swapinfo

Kb Kb Kb PCT START/ Kb

TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME

Dev 1048576 0 1048576 0-1 / dev/vg00/lvol2

Reserve-792332-792332

Memory 781512 318032 463480 41%

71. The use of HP hardware collection tools (suitable for HP11. Version 0 and HP10. Version 0)

How to use information collection tools Info_col.xx and LVMcollect.xx:

A. create a directory on the host that needs to be collected:

# mkdir / tmp/hpce

B. Transfer the collection tools info_col.xx and LVMcollect.xx to the / tmp/hpce directory on the host that needs to be collected:

If the OS used by the host is 10.xx, use the scripts of info_col.10 and LVMcollect.10; if the OS used by the host is 11.xx

Scripts for info_col.11 and LVMcollect.11 are used.

You can transfer to the host using ftp (using asc transfer), or you can use tape tar to the host.

C. Modify the execution permissions of info_col.xx and LVMcollect.xx.

# chmod 744 info_col.xx

# chmod 744 LVMcollect.xx

D. Run the corresponding version of info_col.xx to collect information.

For hosts whose operating system is 10.xx:

# cd / tmp/hpce

# sh. / info_col.10

For hosts whose operating system is 11.xx:

# cd / tmp/hpce

# sh. / info_col.11

E. the system prompts for the corresponding information

Enter the operator's name

Enter the operator employee number (you can enter 6 zeros)

Enter the product model (can be found on the label affixed to the host-"machine model item")

Enter the serial number of the product (can be found on the label affixed to the host-"serial number item")

(note: the serial number must be entered accurately, please check it carefully)

Confirm the input (select "y" and the system starts to collect information automatically)

F. Waiting for the automatic collector to finish, the system will generate an ascii file named "; .txt" in the directory where the collection script is executed (usually the / tmp/hpce directory). This file is the last letter collected.

Information file. Save this file and send it back to complete the information collection.

(note: in fact, a series of commands are used in shell programs, such as ioscan-fn;mstm;sam, etc.)

72. How to set up umask

When you first log in to the system, the umask command determines the default mode in which you create files. This order actually has something to do with

The chmod command is just the opposite. Your system administrator must set a reasonable umask value for you to ensure that you create

The file has the default permissions you want to prevent other different groups of users from having write access to your file.

After you have logged in, you can use the umask command to change the default permissions for file creation according to your personal preference. Correspond to

Is valid until you exit the shell or use another umask command.

In general, the umask command is set in the / etc/profile file, which is referenced by each user when logging in

So if you want to change the umask of all users, you can add the appropriate entry to the file. If you want to be permanent,

Set your own umask value, then put it in the .profile or. Profile in your $HOME directory. In bash_profile file.

How to calculate the umask value

The umask command allows you to set the default mode for file creation, corresponding to each type of user (file owner, same group user,

Other users) there is a number in the corresponding umask value For files, the maximum value for this number is 6, respectively. Department

You are not allowed to give execution permission to a text file when you create it. You must add this with the chmod command after creation.

Permissions. Directories allow you to set execution permissions so that each number in the umask can be up to 7 for the directory.

The general form of the command is:

Umask nnn

Among them, n n n is umask.

Let's look at some examples.

Calculate your umask value:

There are several ways to calculate umask values. By setting umask values, you can set gaps for newly created files and directories

Save permissions. Table 1-8 lists the umask values corresponding to the permission bits.

When calculating the umask value, you can create a default according to the desired file / directory in this table for all types of users

Permission to find the corresponding umask value.

For example, the default permissions for file and directory creation for the umask value 002 are 6 6 4 and 7 7 5, respectively.

There is another way to calculate the umask value. We just need to remember that umask "takes" the corresponding bit from the permission, that is,

download

Table 1-8 umask values and permissions

Umask file directory

0 6 7

1 6 6

2 4 5

3 4 4

4 2 3

5 2 2

6 0 1

7 0 0

For example, what are the default creation permissions for files and directories for a umask value of 0 02?

As a first step, we first write down the pattern with full permissions, that is, 777 (all users have read, write, and execute permissions).

The second step is to write down the corresponding bits according to the umask value on the following line, which in this case is 0 02.

The third step is to make a note on the next line that there are no matching bits in the above two lines. This is the default creation permission for the directory.

You can remember this method with a little practice.

Fourth, for the file, you cannot have the execution permission at the time of creation, as long as the corresponding execution permission bit is removed.

But.

This is the example above, where the umask value is 0 02:

1) maximum permissions of the file rwx rwx rwx (777)

2) the umask value is 0 02-w-

3) Directory permissions rwx rwx rmurx (775) this is the default permission for directory creation

4) File permissions rw- rw- rmai-(664) this is the default permission for file creation.

Here is another example, assuming that the umask value is 0.22 this time:

1) maximum permissions of the file rwx rwx rwx (777)

2) the umask value is 0.22-w-w-

3) directory permissions rwx rmurx rmurx (755) this is the default permission for directory creation

4) File permissions rw- rMui-rMui-(644) this is the default permission for file creation

Commonly used umask values

Table 1-9 lists some umask values and their corresponding directory and file permissions.

Table 1-9 commonly used umask values and corresponding file and directory permissions

Umask value catalog file

022 755 644

027 750 640

002 775 664

006 771 660

007 770 660

If you want to know the current umask value, you can use the umask command:

Chapter 1 document Security and permissions 11

download

If you want to change the umask value, simply use the umask command to set a new value:

$umask 002

Verify that the system has accepted the new umask value:

Be sure to figure out exactly what kind of file / directory creation default permissions you want before using the umask command. No

You may get some very strange results; for example, if you set the umask value to 600, then the file / directory created

The default permission for recording is 066!

Example: how to specify a user's umask value?

73 、 xargs

When processing matched files using the-exec option of the find command, the find command passes all matched files together to exec for execution. Unfortunately, some systems have limits on the length of commands that can be passed to exec, so that an overflow error occurs a few minutes after the find command runs. The error message is usually "Parameter column too long" or "Parameter column overflow". This is what the xargs command is for, especially when used with the find command. The find command passes the matching files to the xargs command, while the xargs command fetches only some files at a time, not all of them, unlike the-exec option. In this way, it can first process the first part of the files obtained, then the next batch, and so on. In some systems, using the-exec option initiates a process to process each matched file, instead of executing all the matched files as parameters at once; in some cases, there will be too many processes and poor system performance, resulting in inefficiency; while using the xargs command, there is only one process. In addition, when using the xargs command, whether to get all the parameters at once or in batches, and the number of parameters each time will be determined according to the options of the command and the corresponding adjustable parameters in the system kernel.

Let's take a look at how the xargs command works with the find command and give some examples.

The following example finds each ordinary file in the system, and then uses the xargs command to test which category they belong to.

File:

The following example looks for a memory information dump file (core dump) throughout the system and then saves the results to the

/ tmp/core.log file:

$find. -name "core"-print | xargs echo "" >; / tmp/core.log

The following example looks for all files that users have read, write, and execute permissions in the / apps/ a u d i t directory, and retrieves the corresponding files

Write permissions of:

$find / apps/audit-perm-7-print | xargs chmod Omurw

In the following example, we use the grep command to search for the word d e v i c e in all ordinary files:

$find /-type f-print | xargs grep "device"

In the following example, we use the grep command to search for the word D B O in all ordinary files in the current directory:

$find. -name\ *-type f-print | xargs grep "DBO"

Note that in the above example,\ is used to cancel the special meaning of * in the find command in shell.

74, Top-s 300-f top.txt

To prevent that sometimes top can't view all the processes, it's best to wait 5 minutes and save the result file to a file, so that you can come back from the file.

Check the results.

The above is all the contents of the article "what are the hp minicomputer commands?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report