Sun basic knowledge

xiaoxiao2021-03-06  37

I. SUN development brief history (1) Hardware system (2) software system II. PROM status command and parameter (1) Instruction set (2) environment variable three. System installation 4.Unix command (1) Basic command 1.ls display File name, equivalent to DOS DIR command 2.cd directory conversion, equivalent to DOS CD command 3.pwd Display the current path 4.cat display file content, equivalent to the TYPE command 5.more to view the file content in paging. 6.RM Delete File 7.mkdir creates a directory 8.rmdir Delete Directory 9.cp Document Copy 10.MV File Mobile 11.DU View Document Update Disk Capacity 12.Find file lookup 13.Man Random Document 14.vi Editor (2) Enhanced Command 1.ln Document Connection 2.Grep Search String 3.FGREP Search String 4.File Display File Type 5.Diff Compare Document or Directory Different Content 6.CMP Compare Document The same section 7.FTP Remote File Transfer 8.Telnet Remote Terminal Access 9.IO ResEN INTET SUN System Management 5. User Management (1) User Basic Knowledge 1. File Information 2. Default Permissions 3. System Security File (2) Related Commands 1.chmod Change the document or directory attribute 2.chown change the ownership of the document or directory 3.chgrp change the document or directory group ownership 4.Touch change the last modification time of the document or directory 5.Who View System Registration User 6.ID View Current user user number and group number 7.passwd Modify User Password 8. SU Convert User (3) Shell Features 1. S OLARIS Three Class Shell 2. B Shell 3. C Shell 4. DTTERM (4) Create, Delete User Account Six . File System Management (1) Hard Disk and File Resources 1. Aggregation of Logical Hard Disk Device Named 2.Dmesg Command 3. SHOWREV Command (2) Hard Disk Partition 1.Format Utility 2.NewFS Create File System 3.FSCK Repair file system ( 3) Mounting file resources 1.mount file system Mount 2.DF Display File System Hard Disk Space 3.umount extracted file resource (4) Automatic mount file resources (5) NFS resources 1.Share, ShareAll Share File Resources 2.DFSHARES Display Remote Machine Share Resources 3.mount Mount Remote File Resource 4./etc/dfs/dfstab Automatic Mount (6) Volume Management (7) Automatic Security File system seven. Process management 1.PS display process number 2.kill clear process 3.nohup non-suspend operation eight. Package management 1.pkginfo display package information 2.pkgadd increase package 3.pkgchk check pack Installation 4.PKGRM Delete Package 5.SPooling Package Transsermation IX. Data Backup and Transfer Tools (1) Data Device Name (2) Data Backup Command 1.ufsdump Command 2.ufsRestore Commands 3.tar Command 4.cpio command 5.compress, uncompress, zcat command 6.mt Command 7.dd Command 8. Using a tape drive in different places (must be trusted users,) Ten. Change the Run Level (1) System Boot (2) System Operation Level 1. Run Level Description. Displays the Run Level 3. Causes of the shutdown system 4. Close system (3) Example: 1. Add a tape drive and complete the reconfiguration boot:

2. Restore from hangs 3. Restore from slight problems 4. Recover the third part of the network configuration from important issues. Network application configuration (1) Network Basic Profile (2) Remote Access Command (3) Access authentication related files (4) Network monitoring 1.RUsers identity network registration user 2.RUP identity network host 3.PING Detection Host connection status 4.NetStat Display Various data structures related to the network 5.Ifconfig Display Network Interface 6 . ROUTE Routing Setting 7.arp Refiscation Evaluation 8.NFSSTAT Monitor NFS Part IV System Application Twelve. Graphical Window Configuration 1. Double Screen Configuration 2. Valid Card Resolution Adjustment 3.xWinInfo Resolution Confirm 4.xhost XServer Access Control 5. OpenWIN initialization 6.cde desktop initialization 7. Terminal window control character thirteen. System statistics 1. PRTCONF system information 2./usr/platform/sun4u/sbin/prtdiag -v 3.sysdef system information 4.ePROM display Machine IDPROM variable 5 .Vmstat monitoring CPU and memory 6.mpstat Monitor Multiple CPU Status 7.ioStat Monitor Disk Status 8.uptime Display System Run Time and the first part of the load condition of the system in the past 15 minutes, one. SUN development brief history ( A) Hardware system annual product features 81--89 Sun1 / 2/3 CISC MOTRALA 680x0 series 89-94 SUN4 / 60 SPARC1 65 SPARC1 70 Sparc2Server:, Sun / 290/670/690 RISC SPARC 93--96 SPARC10 / 20 Server: 1000/2000 SuperSparc 96--97 Ultra1 (140/170 / 170e / 200E) Ultra2 Server:, E150, E3000 UltraSparc, SBUS bus, UltraScsi interface UPA interface 98-99 Ultra5 Ultra10 UltraSparc, PCI bus, IDE interface Ultra30 Ultra60 Server:, E250, E450 UltraSparc, PCI bus, UltraSCSI interface UPA interface (2) Software system version feature Solaris 1.x Sunos 4.1.3 (BSD) OpenWindow 3.0 Solar IS 2.X System V 32bit 2.5.1 Sunos 5.5.1 OpenWindows CDE1.0.2 2.6 SunOS5.6 CDE1.2.1 Motif1.2.6 Solaris 2.7 (7) 64 Bit Sunos7 CDE1.3 Motif2.1.0 logging UFS 2 PROM Status Command and Parameters (1) Instruction Set Format: OK> Instruction Command Description 1. Banner Displays the current machine configuration, CPU, memory, Hostid, Ethernet 2.probe-scsi Display internal SCSI channels 3.Probe -SCSI-ALL Displays all SCSI channels and mounted devices 4.Probe-IDE displays all IDE channels and mounted devices (for U10, U5) 5.devalias display device alias, such as CDROM, Disk, Disk0, Disk1, etc. .printenv No parameters, display environment variables or parameters as environmental variables such as Printenv Auto-Boot? 7.senv Setting environment variables, such as: STENV Auto-Boot? false 8.set-default restores environment variables For predetermined values ​​such as:

Set-default auto-boot? 9.set-default recovers all environment variables for predetermined value 10.boot device Option boot host device alias: CDROM or Disk device name: / pci @ 1f, 4000 / SCSI @ 3, 1 / disk @ 6 0: FOPTION -R device configuration - S single user 11.Eject CDROM | FLOPPY pop-up CDROM or FLOPPY 12.RESET Reset 13.Test Net 14.Watch-Net-All 15.Show-Devs (2) Environment Variable Name Description 1.auto-boot? Subsequent value = true Automatic start = false Enter the PROM State 2.Diag-switch? Subsequent value = false launch status, start the device named boot-device = true diagnostic state, start the device named Diag-Device 3 .boot-device predetermined value = disk 4.Diag-device predetermined value = net 5.tpe-link-test? network detection = True detection network (some machine has this variable). System Installation (1) Waiting for the display Press the STOP A key (first hold STOP first, then press A) Waiting OK Status OK> Probe-SCSI <- Detecting SCSI Equipment, at least No. 0 (HD), No. 1 (HD), No. 6 (optical drive After the device OK> Boot CDROM (2) After the system is started, wait for the installation interface i. System Identification, the following steps to simply describe 1. Install interface language selection, default is ENGLISH 2. Enter the host name (Hostname), enter the original host Name 3. Select whether there is a network, select Yes 4. Enter the IP address, enter the original IP address 5. Name service, select NO 6. Subnet (SYSTEM Part of Subnet), select NO 7. Specify time zone Asian , EASTERN - People's Republic of China 8. Date and Time II. System Installation 1. Allocate Client Service, default is not, Continue 2. Select Languages, Continue 3. Select Software, Select Entire Distribancy Plus Oem Support, Con tinue 4. Select Disk, available disk select disk C0t0d0 C0t1d0 c0t1d0 Select Root location -> c0t1d0 5. preserve data, the default is not retained, continue 6. Automatic layout File system selected Manual layout 7. Customize 0/900 1 swap 300 2 overlap 4200 (hard disk predetermined value) 3 / Space 3000 * 32Bits Sparcs root partition must smaller Than 2GB * And OR LESS (Revision 2.5 or less) root partition must smaller Than 1GB 8.Mount Remote File System, default is not, Continue 9.begin Install 9. Auto Reboot UNIX File System Introduction: UNIX is basically a core (kernel)

Coupled with different programs and documents of each size, UNIX's entire file system is under "root", "root" is a general statement, and the path representation is "/" (this to DOS) Different, the root path of DOS is "/" means that the following is a more important directory / bin binary abbreviation, is compatible with the old system, BIN is the abbreviation of the / usr / bin / devade, contains Unix device file / etc ET Cetera abbreviations, including system management, documents and directories, / home generally planned for use in the user's home directory / liblicray abbreviation, like / bin, has been moved / usr / LIB, here is a directory of link / losts found is empty, but when the system is faulty, if the power outage causes non-normal shutdown, when restarting the machine, some unable to place the document is placed here / TMP TEMPORARY abbreviation Place temporary files, system power-saving / various abbreviation / var / ADM system information and statistics / var / spool file printing and MAIL / VAR / TMP and / TMP are similar, public temporary district, but do not automatically clear, Administrator Maintenance / USR User Abblast / USR / BIN Store Most Instructions / USR / include header file / usr / lib library function / USR / UCB BSD series instruction USR / Man Unix Command Manual Four .unix Command (1) Basic Command 1.ls Display file name, equivalent to DOS DIR command command format: ls [option] file option: -l Display detail site 1: File Type and File Rights Domain 2: File Connection Domain 3: File Owner Name Domain 4: File User Group Name Field 5: File Length Domain 6-8: Recently Modified Date 9: File Name -a Displays all files, contains hidden files (with. File name) -r display file and all subdirectory -F display file (followed by *) and directory (followed /) -d and l option, display directory name instead of its content 2.cd directory conversion, equivalent to DOS under CD command Note that the directory separator is "/", with DOS reverse command format: CD DIRNAME 3.PWD Displays the current path 4.cat Display file content, equivalent to the Type command command format: Cat FileName 5.more View the file content in paging mode. Command format: more filename 6.rm delete File command format: rm [-r] filename (file Name can be file name, or file name abbreviation.) An example: RM file1 deletes documentation with file1. RM file? There are five characters in the file name, the first four characters are File. RM f * Deleting the file, all documentation named with F. RM -R DIR1 Removes Directory DIR1, and all documents and subdirectory below. 7.mkdir creates a directory command format: mkdir [-p] Directory-Name Example:

Mkdir Dir1 creates a new directory DIR1. MKDIR -P DIR / SUBDIR Create Multi-level Contents 8.rmdir Deleting Directory You must first first format: RMDir Directory 9.cp Document Replication Command Format: CP [-r] Source Destination example : CP file1 file2 copies the document file1 into file2 CP file1 DIR1 to copy the document file1 to the directory DIR1, the file name is still file1. CP / TMP / file1. Copy the document file below the directory / TMP to the current directory, file name Still File1. CP / TMP / File1 File2 In the current directory of document File1 under the directory / TMP, the file is filed with File2 CP -R Dir1 Dir2 (Recursive Copy) Copy the entire directory. If the directory DIR2 exists, the directory DIR1, and All documents and subdirectories are copied to directory DIR2, and the new directory name is DIR1. If the directory DIR2 does not exist, copy DIR1, and all its documents and subdirectories, copied to the directory DIR2. 10.mv file Mobile Command Format: MV Source Destination example: mv file1 file2 Change the document file1, change the file name File2. MV file1 Dir1 Moves document file1, moved to the directory DIR1, the file name is still file1. MV DIR1 DIR2 If the directory DIR2 exists, the directory DIR1, All files and subdirectors are moved to the directory DIR2, and the new directory name is DIR1. If the directory DIR2 does not exist, change DIR1, and all its documents and subdirectories, change to the directory DIR2. 11.DU View Directory The disk capacity command Format: DU [-sk] Directory example: DU DIR1 Displays the total capacity of the directory DIR1 and its number of capacity DU -SK DIR1 Displays the total capacity of the directory DIR1, with K Bytes as metered 12.Find file lookup command format: Find Dir - Name FileName Command Example: Find. -Name Hello -Print Looking for the current directory and all sub-directory called Hello's document. Find. -ctime 7 -print identifies the unhappy document Find. -size in seven days. 2000M -PRINT Document Finding Document Find / TMP -User B1234567 -Print belongs to the document Find. -Name '* .c' -EXEC RM {} deletes all .c files Find under / TMP. -name test / * -print Displays the current directory and its subdirectory file name 4 bit file name 13.Man random document example: man ls | col -b> ls.txt Generate text Document CATMAN -W -M / USR / man generated index keyword man -k keyword keyword Find Man -s Number Word Different System Category EXAMPLE: MAN -S 3S Printf 14.vi Editor Command Status: J, K, H, L: Up and down 0: Live $: Tail I, I: Insert Command, i Insert the I-line Head Insert a, A: Additional Command, A, apart after the current cursor, A is added at the end of the line, o: Open the command, o in the current line Open a line, o Insert a row R, R: replace command, R: R: replace the character, R: replace the current cursor,

R Start from the cursor S: Replace the specified quantity character x: Delete the cursor Character DD: Delete the current row D0: Delete the cursor half a row D $: Delete the cursor half a line Ctrl f: turn pages Ctrl B: Before Turn page G: File Tail Digital G: Digital Number Spectrum / String Finding Strings N Continues N-reverse Continue Find% Finding Case U Cancel The EX Command Status: SET NUMBER Display Line No.: SET SMD Display Display Status : 0 Files: 1, 5 COPY 7 blocks: 1, 5 DEL block delete: 1, 5 Move 7 block movement: 1, $ s / string1 / string2 / g full file lookup String1 and replace String2: WQ! Exit (2) Enhanced Command 1.ln Document Connection Command Format: ln [-s] OldName NewName Same document, you can have more than one name, you can do a single link. A symbol chain is specially to the other file of the system. File, when accessing this file, it stores a path name, which is used to guide the user to the file or directory example of the user to the card symbol chain: ln -s file1 file2 will connect the name File2 to the document file1. 2.Grep Search String Command Format: Grep String FileName Looks for a lot of methods, such as I want to find all the best in M. This must introduce Pattern's concept. Here are some simple □ examples, and description: ^ M starts in m, ^ indicates that the mean of M is M $ is ended in M, and the meaning of the end is the end of the meaning ^ [0-9] starts with the number, [] can list the letter ^ [124Ab] to 1 , 2, 4, a, or b starting line ^ B.503 Status represents either letter * asterisk indicates that more than 0 letters (no) plus sign indicates more than one letter /. The slash can remove special Significance CAT passwd | grep ^ B lists the university department has an application account number list cat passwd | grep ^ S lists the exchange student application account number list Cat Passwd | Grep '^ B.503' Lists the motor system. .. grep '^ /.' myfile.txt lists all rows that start at the beginning 3.FGREP Search String Command Format: FGRep String File 4.File Display File Type Command Format: File FileAl File Type Shell Script, ELF 32bit ASCI I Text, Data or TAR File 5.diff Compare Document or Directory Different Content Command Format: DIFF [-r] Name1 Name2 (Name1 Name2 can be mataly named, or directory name.) Example:% Diff file1 file2 Compare Document File1 With File2, each line is different.% DIFF -R DIR1 DIR2 comparison directory DIR1 and DIR2, the differences between each document. 6.cmp comparative document The same partial command format: CMP file1 file2 7.ftp Remote File Transfer Command Format: FTP [Hostname | IP Address] After entering the FTP, if it is connected to the Remote Host, it will ask you username and password. If the input is correct, you can start the document transfer. Note: If the user has no password,

Unable to register (1) FTP command ASCII Sets the transfer mode to ASCII mode. It is usually used to transfer text files. Binary set the transfer mode to binary mode, usually used to transfer execution files, compressed files and images CD Remote-Directory will remote host The working directory changes. LCD [Directory] changes the working directory of the local host. Ls lists the documents on the remote host. Get Remote [Local-file] achieves a distant document. MGET Remote-files can use the general-purpose character once Document. PUT LOCAL [Remote-file] Sends the document of the local host to the remote host. MPUT local-files can use the general-purpose character to place multiple documents on the remote host. Help [command] Online auxiliary instructions. MKDir Directory-name creates a directory at the remote host. Prompt changes the conversation mode. If ON is in the MPUT and MGET, each time a document is transmitted, the quit / bye leaves the FTP. (2) The background execution FTP 1. First The instructions used in the process are placed in the document, as follows:% CAT ftp_command! Mkdir test lcd test cd test prospt binary mget *. * Bye 2. Next, build a .NETRC file, attribute is 400, let FTP automatic To this, read UserName and Password, the host can smooth Login, as follows:% Cat .Netrc Machine Remote Login Anonymous Password Guest 3. Finally, the following instructions can be executed.% NoHUP FTP Remote Message & 8.Telnet Remote terminal access command format: telnet [hostname | ip address] * Note: If you log in with the root user, please refer to 11.3.4 9.IO Re-directed UNIX All program executions require the input and output information. In general, the information is input from the keyboard and outputs the data to the screen, which is called standard input and standard output, and we can change the standard output. A. Change standard input - in the command rear "< FileName> "You can enter information from . B. Change the standard output - in the command Adding "> ", you can guide the data output to the . C. Change the standard output - add ">> " in the command, the function is similar, This will add information to the rear of the document. D. Pipe - add '|' in the middle of the two commands, you can use the output of the front instruction as a rear instruction. Example: CD / TMP ls -l> / TMP / ls.out cat /tmp/ls.out more /tmp/ls.out rm /tmp/ls.out ls | more ls | wc -l (Word Count, Count Line Number, Calculating Document Number) Second Some SUN System Management 5. User Management (1) User Basic Knowledge 1. File Information Ls -l Drwxrwxrw FileName (1) Access Mode: RWX RWX RWX R: Read W: Write X: Execute User Group Other Abbreviation: (U) (G (o) (2)

File Type -: Ordinary Files B: Block Special Documents, such as hard disk and CDROM devices C: Character file devices or "RAW" device files l: symbolic connection P: pipeline or stream, used for process communication D: directory 2. Default Permissions Create a file and directory, the system automatically sets certain permissions. Default permissions by User Mask Code Control $ UMASK & Display User UMASK Code UMASK Settings File Directory 022 New file owner has read rights and modification user groups and other users Reading rights and modifying rights user groups and other users only have read rights available Umask MaskValue to change the default permissions 3. System security files / etc / passwd User registry / etc / shadow encryption password / etc / group user group / etc / default / login Access Control Description: The Passwd file is the first file for users in the system and the authentication access. It uses ':' segmentation. Login_name: passwd_field: uid: gid: comment: Home_directory: default_shell login_name User Unique login comment Note (Finger Used) Passwd_field Encryption Password Security Tag Home_directory User Registrant Directory UID User No. Default_Shell Command Interpreter GID User Default Unique Settings Default: SH, CSH, KSH Shadow File Manage User Encryption Password, this file is only available to superusers Reading rights login_name: Encrypted_pass: Last_Change: MIN: MAX: WARN: INACTIVE: EXPIRE: RESERVED LOGIN_NAME Username (same passwd) MAX password effective maximum number of eNCRYPTED_PASS 13 Character long encryption password WARN password How many day warning Last_Change last change date (From1970.1.1) Inactive is prohibited before logging in, the account is not active days minimum number of minimum number of space users prohibit logging in absolute date (usually blank) Group files for users of users: passwd: GID: user-list groupname Unique Group name GID The unique identification number of the group name provided by the operating system PASSWD group encrypted password user-list all accessible to the user's list of users to access the group of UID and GID Each username in the system is given a UID (User Identification Number User ID), these numbers are between 0-60000, the system uses the UID to set up a username and operating system to the identity of the user, establish a user When it is necessary to ensure that the UID is unique. GID (Group Identification Number, Identification) follows the same format as UID, range 0-60000, each user belongs to a group, and can belong to multiple groups.

(2) related commands 1.chmod change document or directory attribute command format: chmod [-r] mode name (Name can be a file name or directory name; Mode can be 3 8-bit numerals, or using ls -l Command, listing the document or directory, write, performing the text abbreviation of allowed rights.) An example:% chmod 755 DIR1 sets the directory DIR1, set to any user, all have the right to read and execute, but only the owner You can make a modification.% Chmod 700 file1 sets document file1, sets only owners to read, write, and execute.% Chmod u x file2 will file file2, add the owner to execute rights.% Chmod g x file3 will document File3, increasing the rights of group users can perform.% chmod or file4 removes document file4, removes other users to read rights.% chmod ar file4 will document File4, remove all users to read right. 2. Chown change the owner of the document or directory: chown [-r] username name (Name can be a file name or directory name.) An example:% chown user file1 has the right of the document file1, change it to the user user.%.% Chown -R user dir1 will change the directory DIR1, and all documents and subdirectories, and all documents, and all documents, all. 3.chgrp Change the Document or Directory Group ownership command format: chgrp [-r] Groupname Name Name can be the name or directory name) example:% chgrp vlsi file1 will have the power of the group of documents File1 to change to the VLSI group.% chgrp -r image dir1 change the directory DIR1, and all documents and subdirectories, Image group. 4.Touch change the last modification time command format of the document or directory: Touch Name (Name can be a document or directory name.) 5.Who View System Registration User 6.ID View the current user number and group number 7. Passwd Modify User Password: Passwd UserName No User Parameters Modify this user password, the user password must be at least 6 characters long, up to 8 characters, at least two alphanumeric characters in the password, and a digital character 8. SU conversion user command format: Su [-] UserName No User Parameters Convert to Super User -: Performing a New User Environment Set Su -Cr OOT DBSHUT (3) Shell Features 1. S Olaris Three Class Shell - Bourne (Default Shell) - C - Korn Shell Basic Features Bourne C Korn Almimeher Mechanism No Yes Yes Enhanced CD (CDPATH) Function Yes Yes Yes History List NO YES YES Job Control No Yes YES A Preventive File Override No Yes YES ignore Control_D No Yes Yes 2. B Shell (1) Variable Setting Upset: Terminal Type: Term = VT100; Export Term Language Environment: LANG = C; Export Lang Execution Path : Path = $ path: / usr / bin :.; Export Path Display Terminal: Display = Host: 0.0; Export Display (2) Environment file .profile 3. c shell (1) Variable Settings Set Define Variable Stenv Defining Environment Variables ( The environment variables and variables differ from environmental variables to affect sub-process): Terminal type:

STENV TERM = VT100 prompt: set prompt = "i love unix>" path variable: set path = ($ path / usr / bin.) Display terminal: STENV Display Host: 0.0 Sharing Library: STENV LD_Libraray_Path / USR / DT / LIB : / usr / openwin / lib (2) Environmental file .login .cshrc (3) Script language case 1: Replace the suffix foreach file (* .ab) set base = `basename $ file .ab` mv $ file $ base.cd END Case 2: Simple loop @ cnt = 1 echo i will count from 1 to 100 echo and pause at every ten numbers for confiution to continue echo -n press an key to start: #Nush to use the data does not enter set key = $ # Accept input character while ($ CNT <101) Echo this is $ CNT IF (`Exp $ CNT% 10` == 0) Then Echo -n" Continue or NOT (Y / N) "set key = $

1. Instance name of the hard disk. 2. The physical device name of the hard disk. 3. Hard disk market name and hard disk profile information characteristics. The logical device name of the hard disk is a symbolic connection to the physical device name of the hard disk. The instance name of the hard disk is physics The abbreviation of the kernel of the device. Solaris command does not use this to represent the hard disk. 3. SHOWREV command (2) Hard disk partitions use the character device files and block device files in the device directory to access the hard disk. However, the hard disk is not directly accessed by the user The partition is represented by the partition, the partition is represented by the device file in the device directory. "Slices" is another statement of "partition". Partition is a convenient way to manage data. Important system files and The program can exist a partition, while the user generated files in another partition. It maintains different types of data in different partitions. This allows system administrators to flexibly utilize data or use different backup mechanisms. Because the user's data daily All changes, the system administrator should be backed up every day. The important system data is not often changed, and there is no need to make backup. The hard disk partition provided by Sun can be up to 8, with 1-7 ID. Partition 2 The entire hard drive. Partition 5 Represents the / opt file system, this file system is used to store software that is not provided together with the operating system. Partition 6 is / usr partition, this file system contains those that can only run on some types of systems Files (such as sparc executables) and some files that can run on all system types (such as online manuals in / usr / share directory). The file system of partition 7 is called / export / home. This is the user The mount point of the directory. The hard disk partition is accessed by logical device files in the / dev directory. Such as / dev / dsk / c0t0d0S0 represents the first partition on the first hard disk. 1.Format utility format is a hard disk maintenance Tools, use the system administrator, complete the following tasks: • Reformat the hard drive. · Change the partition size. · Repair and analyze the hard disk sector. It is similar to the fdisk command part identification partition number 0-7 in DOS. Tag display partition Tags, partition tags are used to identify the purpose used by the partition (root, usr, home, switched area). Flag displays partition flags to identify access rights. Cylinders displays the starting and termination of the cylindrical number. SIZE prescribed ways, Display partition size in mbytes or gbytes. Blocks is identified by the number of column numbers, the number of heads, and the number of sectors. 2.NewFS Create a file system command format: Newfs Raw-Device is equivalent to format command example: newfs / DEV / RDSK / C0T1D0 S0 3.FSck repair file system command format: fsck Raw-device equivalent to DOS Chkdsk Command Example: FSCK / DEV / RDSK / C0T1D0S0 (3) Mount File Resources 1.mount file system is attached to local or remote file resources Go to the root file level, it looks like a single file system. This connection is called "Mount", using the mount command to complete the file resource is called the root file hierarchy is called a hook point. In the call mount command Before, the hooks must exist. Command format: mount file_name mount_point No option The mount command displays the currently mounted file resource. Example: # mount / dev / dsk / c0t3d0s0 / export / home monitoring file system 2.DF display file system The hard disk space DF -K command occupied by KBytes displays the total amount of available hard disk space and the used hard disk space. The meaning of the domains is:

FileSystem is hosted file system. KBytes is based on the file system size calculated by Kbyte. Used the number (kbytes). Avail is available (kbytes). Capacity has been used. MOUNTED ON Mounting point. Note: About 10% The hard disk space is reserved for the file system, and this is not reflected in the output of the DF -K command. 3.umount takes off the file resource from the local system, and the super user can use the umount command. Command format: # umount mount_point If there is activity in the mounted file resource directory, the file resource is not taken. In the picking of the previous CD to / directory is a good habit, do not distinguish the file system required to run the system normally Next. (4) Automatic Mount File Resource / etc / vfstab file system boot read / etc / vfstab file to automatically mount file resources. This file contains registration items for local and remote file resources. The meaning of all domains: Device- TO-MOUNT identifies NFS servers and file systems, or histed local file systems. Device-to-fsck identifies local original devices for performing FSCK. Mount Point Mount Path. FS-TYPE file system type, usually UFS Used for local file systems, NFS is used for remote file systems. FSck-passs Digital in this domain is the order in which FSCK is checked by file system. Automatic hooks when booted. Mount-options defines hook options, such as read / write access. Domain - represents no options. / Dev / [r] DSK / CWTXDYSZ for local UFS file systems .w, s, y , Z represents the controller, target, equipment, and slice, respectively, once the system is established, joined the remote file resource registration in the single-machine system / etc / vfstab file. UFS file system HSFS file system ISO9660 file system is for CD-ROM Standard file system, is often referred to as a high siera file system.

ISO9660 file system extension, called Rockridge Extensions, using the UNIX type path name instead of the 8 3 tag method used on the ISO9660 CD-ROM installed PCFS file system / proc file system installed in the / proc file system, in physical Presented, it is a representative of a file system in a system memory and a UNIX kernel state, and its storage process TMPFS file system SWAP partition and RAM mapped to / TMP / DEV / FD file descriptor (5) NFS resource Sun's NFS distributed file system allows Sharing their resources on the machine. NFS file system allows the machine to share local file systems and directories, allowing remote user to access these file systems and directories as local users. 1.Share, ShareAll shared file resource Share -o Ro User Directory /etc/init.d/nfs.server start 2.dfshares Display Remote Machine Share Resources DFShares Remote 3.DFMounts 3.mount Mount Remote File Resource Mount Remote: Directory Localdir 4./etc/dfs/dfstab Auto Mount (Six ) Volume 1./etc/init.d/volmgt [start | stop] boot volume management 2.volcheck Check floppy disk, if there is a hook in the floppy directory 3.Eject [CDROM | FLOPPY] pop-up device (7) automatic installation File system auto_master, auto_home direct image indirect image seven. Process management 1.PS Display process number command format: ps -ef 2.kill Clear process command format: kill -9 pid 3.nohup non-suspended run 8. Package management 1 .pkginfo display package information command format: pkginfo -d [device | pathname] -l pkg_name example: These three domains are: PKG_Category software package type, can be Application, Graphics or System. Pkg_name package name, such as Sun Product Then, Sunw started. Description software product brief description. Example: # pkginfo -d /cdrom/solaris_2_2/s0/solaris_2.2 | More uses the pkginfo -l command to display details about the package, including the size of the package (press hard disk Block size calculation). # Pkginfo -d /cdrom/solaris_2_2/s0/solaris_2.2 -l sunwaudio The last line of the last line of the output indicating the size of the package. Use this information and DF -K command to determine if you have enough hard disk space Install this package. 2.pkgadd adds a package to add a package using the pkgadd command. When the package is successfully installed, send a message to root. Command format: pkgadd -d [device | pathname] PKG_NAME example: # pkgadd - D /CDROM/Solaris_2_2/s0/Solaris_2.2 Sunwaudio 3.PKGCHK Verification Package installation pkgchk command to verify the properties and pathname content of the package with the value in the system record file. Command format: PKGCHK [-p path1 [pat2 ...]] This command can check the entire package or check the special path name by specifying the -p option. No output means no problem is checked. Due to the / etc / group file size Has been changed,

So the content of the file content is wrong. Ticket information pkgadd command update file / var / sadm / install / contents, this file is a record file for all installed packages in the system. There is no simple way to determine a package has a certain A special file (or command). For the installed package, find the path name of this package from the / var / sadm / install / contents record file. 4.pkgrm Delete Package Command Format: Pkgrm Pkgname1 Pkgname2 ... After the PKGRM command, you will warn the software package information with dependencies, and provide a prompt to abandon this operation. When the package is successfully deleted, send a message to root. Pkgrm command via file / var / sadm / install / Contents to determine the address of the package, and update this file after the package is deleted. If this package is shared by two or more packages, it must be deleted in all packages dependent on this package. Delete this package. 5.spooling Pack Pack Pack A package can be copied in the installation CD-ROM in the system, but not installed this package. For example, a server can copy a package, one is not The system of the CD-ROM device can be picked up from the server to install. The two pkgadd commands under the server are used to explain how to spool a package to / var / spool / pkg directory or to a specified directory. .pkgadd command -s spool option defaults to the / var / spool / pkg directory. You can specify a directory as the parameter of the -s option. Customer, if the server shares the / export / pkgs directory, Customer system can mount directory / export / pkgs and install package. # Mkdir / export / pkgs # mount venus: / export / pkgadd -d / export / pkgs sunwaudio Delete Spooled package on the server Use the -s option to remove a package from the spooling directory. # Pkgrm -s / export / pkgs Sunwaudio related to the package management / var / sadm contains the directory / opt / pkgname installation of the system log file and management file The recommended directory for packages called pkgname together with the operating system. / Opt / pkgname / bin / OPT / BIN The recommendation directory of the execution file named pkgname is not provided together with the operating system. VAR / OPT / PKGNAME / etc / opt / pkgname is not provided with the operating system, the recommended directory named pkgname record file. / Var / SADM / Install / Contents Software Packaging of the entire system. Nine. Data backup and transmission tool (1) Data equipment name 1. Tape type device name capacity continuous rate burst rate machine type 8MM D8112 5G-10G 8205 8MM D8160 7G- 14G 8505-8705 8MM D8170 20G 1MB / S 5MB / S 8900 4MM DDS1 (60M) 1.3G 4MM DDS2 (120M) 4G-8G 4MM DDS3 (125M) 12G-24G 1MB / S 10MB / S device name: / dev / rmt / 0, / DEV / RMT / 0N (not riding) 2. Floppy disk device name: / dev / fd0 or / dev / rdiskette Un Running Boot Management / VOL / DEV / ALIASES / FLOPPY0 Running Tag Management 3. File ( two)

Data Backup Command Solaris 2.x The computing environment provides several commands for backup and recovery files and file systems. Multi-volume backup connection system bridge ufsdumprestore yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes) For those concerns, ufsdump commands are useful to do a complete or incremental dump for the entire file system. The full dump is backup for the entire file system. Once a longer interval, such as a week or January. Increment The reservoir is backup for newly created or modified files. The incremental dump is more frequent, possibly one day. Ufsdump command provides a different type of dump, from 0 to 9. The dump level is used to determine which file backups are used. Level 0 Specify full dump, 1 to 9 Specify different levels of incremental dumps. For example, the incremental dump (level 1) will back up files after the previous low level (level 0) dumps, modify or created files When a file system is backed up, the system should be transferred to the run level S. If the system is running level 3, the file may be in use, so it may cause an invalid backup. Example: # ufsdump 0uf / dev / rmt / 0 / export / Home options and parameters: 0 Specify 0 (complete) dumps. U update file / etc / dumpdates to record successful dumps. F and the following / DEV / RMT / 0 parameters determine the dump tape device. / DEV / RMT / 0 Tape Device. / Export / Home Specifies the file system to be diced. 2.ufsRestore Command UFSRESTORE command copy file from the backup tape to the current directory. UFSRESTORE command can be used for heavy duty storage Single or multiple files on the entire file system or backup. UFSRESTORE commands The options for specify the path name of the tape device name and the recovered file. Recovery procedure is used by UFSRESTORE command to restore a file: # CD / newdir # ufstore TUF / DEV / RMT / 0 file system copy # mount / dev / dsk / c0t1d0s0 / mnt #ufsdump 0f - / dev / rdsk / c0T0D0S0 | (CD / MNT; UFSRESOTRE RF -) #installboot / usr / platform / `uname -i `/ lib / fs / ufs / bookblk raw-device 3.tar Command TAR command is a user-level backup command for backup and recovery files or directories. Command format: tar options tape_devi CE_NAME [FileName] Option C- Create a new document V-display path T-Display file list f-specified device X-extraction file I-interactive example: (1) Backup process: $ TAR CVF / DEV / RMT / 0 * ( 2) Recovery Process: $ TAR XVF / DEV / RMT / 0 (3) Directory Copy $ TAR CVF - MyDir | (CD NewDir; Tar XVF -) (4) Off-site copy (must be trusted users, see 11.3) $ tar CVF - MyDir | RSH Remote Tar XVF -; Copy mydir directory to remote host $ RSH Remote Tar CVF - mydir | tar xvf -; copy Remote host mydir directory to this machine 4.cpio command CPIO (Copy In / OUT) command is User-level commands generated multi-volume backup. Command format: CPIO -OV> TAPE_DEVICE_NAME CPIO -I [VT]

Such as a tape device. It is inserted between the files to facilitate recovery, so it is slower than the tar command. The CPIO command can be used as a parameter, however, the CPIO anti-inquiry is used, which in addition to the matching condition, which will back up all files. Backup Procedure $ FIND. -Depth -print | cpio -ov> / dev / rmt / 0 Find command provides a list of files and directory names to the cpio command. The -o option represents the read. / DEV / RMT / 0 parameter determined Tape device. An example: Back up the primary directory to the tape with the Find and CPIO commands: Recovery Procedure Use the cpio command to retrieve files and directories from the tape. 1. Insert the tape into the tape device. 2. Change the directory to / tmp 3. Use the following CPIO directory to determine the path name of the file to be recovered. $ Cpio -iv

Also the default state of the system All system processing is executed, the file resource can be used, the user can be registered. (2) Run Level S, S Run Level S is a single user mode, is a special operation level. Operating system is being executed However, all users are logged out, most system processing, such as printing, mail, etc. have not been executed. Only one user, that is, the superuser is registered with the system. Running level is very convenient, because no user registration, all The data is stable. The system is brought into the run level S, S. (3) Run Level 0 This level is shut down, so this level is safe. (4) Run the power source. 5 This level shutdown system is off the power status. (4) Run Level 6 Run Level 6 Used to turn off (HALT) system to level 0 and reboot to level 3. 2. Display operation level call who -r command can Display system run level. $ WHO -R Run-Level 3 Feb 6 15:46 3 2 S In this example, the system is in the default level 3. Other domain representations: Feb 6 15:46 The last run level change date And time. 3 Current run level. 2 The number of times the level is running again after the last re-guidance. 3. The reason for the shutdown system (1) The SunTM workstation is designed for working hours. But there must be When the system is turned off, the run level S is used for system maintenance, such as completing backups. This system level change is still considered to be closed. (2) Change a system configuration, such as increasing or deleting a tape machine or CD- ROM machine. (3) Change the system hardware configuration, such as increasing or removing a CPU board. (4) Recovery from extreme conditions, if a hangs do not respond to all recovery work, it may be turned off the power supply Start. 4. Shutting Down Off System differently varies depending on the reasons of the shutdown. Performing off is to transfer to the execution level S, some are to stop the operating system and turn off the device's power. (1) / usr / sbin / Shutdown -gtime -ilevel -y (2) init 0 (3) Halt (4) stop a; SYNC (5) Turn off the power supply emergency, press STOP_A, such as STOP_A does not work, turn off the device power to open again. this It is extremely extreme. These two methods are not clean, it is suddenly closed, only in emergencies. (3) Example: 1. Add a tape drive and complete the reconfiguration boot: (1) Become a super user, and confirm In / (root) directory. (2) Type Touch command: # Tou Ch / reconfigure (3) Type the following closes: #halt (4) Turn off the device power. (5) Add a tape drive. (6) Equipped with the device. 2. Recover all the workstations, such as a pending workstation When the typed command is not reacted, use the following procedure to recover: (1) Press the STOP_A to abandon the system and move to the PROM monitor level, the prompt is:> or OK (2) Type the sync command to synchronize the disk. (3) Once you see " Syncing file system ... done information, then press STOP_A. (4) Send the boot command to return to multi-user mode. 3. Restore such as / etc / default / login registry to prevent superuser registration, nor The user account can be registered, and the following steps can be used to recover: (1) Press STOP_A to abandon the system and move to the PROM monitor level. (2) Enter the sync command to synchronize the disk. (3) Once you see "SYNCING FILE SYSTEM ... DONE" information ,

Press STOP_A. (4) Send boot -s command to execution level S. OK boot -s (5) Modify the / etc / default / login file to make root can be registered. # CD / etc / default # vi login (6 Press CONTROL_D to enter the run level 3. In this process, you may be prompted to enter the root password. 4. Recover from important issues If you have forgotten the root password, or in / etc / passwd file is invalid The following steps can be recovered by: (1) Install the CD-ROM disk from the Solaris 2.x as separate boot. # Boot CDROM -S (2) Set the terminal type. # Term = sun; Export Term (3 ) Mount appropriate file system and edit Passwd and Shadow files. # CD / # mount / dev / dsk / cd3d0s0 / mnt # cd / mnt / etc # vi shadow (4) Remove file system. # Umount / mnt (5) ) Reboot system. # Reboot Part III Network Configuration Eleven. Network Application Configuration (1) Network Basic Profiles Leavers Leavers Detc/Hostname.hme0 Network Interface Name You can create hostname. HME0: 1. Construct the second network interface 3./etc/netmasks network mask 4./etc/inetd .conf service project definition can be row through the annotation service (2) Remote access command 1. rlogin Remote machine registration command format: rlogin hostname -l username 2. RSH executes a program in the remote machine: RSH hostname -l username ORDER 3. RCP Copy file command format between remote systems: RCP Host: filename filename (3) Access authentication related files When Rlogin, RSH, RCP commands, there are several files to network security. 1. / etc / passwd If the password file of the remote system has the registration of this support, [-l must be used ] Options to indicate different users 2. $ home / .rhosts rlogin, RSH, RCP first check the .rhosts file under the user's home directory, such as host and user are listed in the file, this user is a trusted host, no password You can log in, such as remote authentication failure, normal Inquiry password 3. /etc/.hosts.equiv effect is similar to .rhosts file, list users list users for trusted users without passwords (except for superusers) 4. / etc / default / login Console = / dev / console (default) root users can only log in to console = - disabled users with root users # console = / dev / console pair login unlimited (4) network monitoring 1.RUsers identify the online registration user command Format: RUSERS -LA 2.RUP Identification Network Host Command Format: RUP 3.PING Detection Host Connection Status Command Format: Ping [Hostname | IP Address] 4.NetStat Displays the various data structural command formats related to the network: NetStat - [R | I] n -r: Display Routing Information -i: Display Interface Information 5.Ifconfig Display Network Interface Command Format:

Ifconfig -a where LO0: This machine self-feedback interface LE0: 10M interface hme0: 100m interface hme1: second 100M interface QE0-QE3: 4 port network card 6.route routing set command format: route [add | delete] Set network routing defaultrouter <- Default Static Routing 7.arp Reversal Analysis Command Format: ARP - [A | S] ARP -A Displays the current IP-MAC information corresponding table 8.NFSSTAT Monitor NFS -S Server -c Client Gateway: Norip ipdptp0 no router defaultrouter RPCINFO -P Part IV System Application 12. Graphical Window Configuration 1. Double Screen Configuration (1) Command Line: / USR / OpenWIN / BIN / OpenWin -dev / DEV / FB0 -DEV / DEV / FB1 (2) CDE Configuration File: / usr / dt / config / xservers 2. Ffbconfig # creator, creator3d (2) m64config # pgx8,24 (3) AFBCONFIG # M3, M6 Command Format: Order -res mode mode:? Or 1280x1024x76 View configuration: Order -prconf 3.xwinInfo resolution confirmation 4.xhost xserver access control command format: Xhost # Enable customers Access 5.OpenWin initialization / usr / openwin / lib / openwin-init $ home / .Openwin- Init / usr / openwin / lib / openwin-menu-program 6.cde desktop initialization / USR / DT / Conifg / C / DTWMRC Details Man DTWMRC .cde Log $ HOME / .DT / ERRORLOG; $ HOME / .DT / StartLog ; / var / dt / xerrors. Double-screen defined second table Keys DTKEYBINDINGS {MetAright root | icon | Window F.Next_Workspace Metaleft root | icon | Window F.Prev_Workspace} .Menu DTROOTMENU {"Workspace" f. Title "cmdtool" f.exec "/ usr / openwin / bin / cmdtool"} 7. Terminal window Control Character ERASE ^ H INTR ^ C Kill ^ U Start ^ Q Stop ^ s SUSP ^ Z Definition method: stty ERASE ^ H * Note This feature often needs to use thirteen after Rlogin, Telnet remote server. System statistics 1. PRTCONF system information prconf -v Display OBP version 2./usr/platform/sun4u/sbin/prtdiag -v display system information (including memory, CPU,

转载请注明原文地址:https://www.9cbs.com/read-55637.html

New Post(0)