Solaris common command

xiaoxiao2021-03-06  53

OK> show-devs

OK> show-disks

Terminal control CTRL S: Termination screen output, if you use the CAT command to output Ctrl Q: Restore Ctrl Q output Ctrl C: Interrupt the current activity, return to the command prompt Ctrl D: Represents the file End or exit, such as exiting the terminal window Ctrl u: Erase the entire command line Ctrl W: Erase the last word of the command line Ctrl H: Erase the last character BC: Calculator

#ksh switch to K shell

command:

# uname sunos name

#man uname uname - Print Name of current System

Synopsis uname [-AIMnPRSVX]

Uname [-s system_name] # date 2004 May 19, Wednesday, 21:49 49 seconds CST # STINGS $ STINGS / USR / BIN / CAT can be used to print the readable characters in the executable or binary.

Cat more

#cat -n test.txt // Display line number

Key Value Destination Space Scroll to the next screen Enter a scroll one-row B backward Move ahead F forward moving one-screen H Shows more features help menu q Exit, return the shell prompt / String forward search string String n Find next one match

Less #less test.txt // Move one-screen F, then b, / string lookup characters

Head #head -5 /export/HOME/Wing/test.txt // Display start 5 line # Head chap * | More // Show all headers of files starting with CHAP to display one or more files N line, the default omitted-N parameter will display the top 10 lines of the file.

Tail #TAIL-5 /EXPORT/HOME/Wing/test.txt // Displays the last 5 line #tail 5 /export/Home/wing/test.txt // Display Chapter 5 Start to the end to display a file Last N row, the default omitted -N parameter will display the last 10 lines of the file.

# Tail -f / var / adm / messages // Real-time automatic browsing syslog entry Oct 6 00:20:26 Wing genunix: [ID 936769 kern.info] SD0 IS / PCI @ 0, 0 / pci-idE @ 7,1 / IDE @ 1 / sd @ 0,0 Oct 6 00:20:26 Wing PCPLUSMP: [ID 637496 Kern.info] PCPLUSMP: FDC (FDC) Instance 0 Vector 0x6 Ioapi C 0x1 Intin 0x6 IOAPI CPU 0 OCT 6 00 : 20: 26 WING Last Message Repeated 1 Time Oct 6 00:20:26 WING ISA: [ID 202937 Kern.info] ISA-Device: fdc0 Oct 6 00:20:26 WING FDC: [ID 114370 kern.info] FD0 AT fdc0 Oct 6 00:20:26 WING GENUNIX: [ID 936769 Kern.info] FD0 IS / ISA / FDC @ 1,3f0 / fd @ 0,0 oct 6 00:20:30 WING I8042: [ID 526150 KERN. Info] 8042 device: mouse @ 1, mouse8042 # 0 c c:: [ID 936769 kern.info] mouse80420 is / ISA / I8042 @ 1,60 / mouse @ 1 o 00:21:37 WING Login: [ID 722452 Auth.error] User2NetName: (NIS Lookup): Error In Accessing N IS COLD START FILE ... IS NIS Installed? Oct 6 00:21:47 WING Last Message Repeated 1 Time Oct 6 00:52 : 07 WING LOGIN: [ID 722452 Auth.error] User2NetName: (NIS Lookup): Error In Accessing N Is Cold Sta RT FILE ... IS NIS INSTALLED? WC #WC /EXPORT/HOME/Wing/Test.txt // Displays the line, words, bytes

#WC -L /EXPORT/HOME/Wing/Test.txt // The number of rows of files display

Option function -l statistics number -w statistical word number -C statistics bytes -M statistical characters

DIFF #diff -i test.txt test2.txt // ignore the case in the article #diff -c test.txt test2.txt // Detailed comparison generation a difference table

Touch #Touch Test1.txt Test2.txt Test3.txt // You can create multiple files at a time

Mkdir #MKDIR / EXPORT / HOME / WING #MKDIR -P / EXPORT / HOME / WING / / The directory that does not exist in the path will be created #RMDIR DIR // The directory to be deleted must be empty

RM RM -I Test.txt Test2.txt // Interactive Delete File RM -R / TEM / TESTD / / Remove Directory and Directory RM -IR / TEM / TESTD // Intensive Delete Directory and Directory file

CP cp -i oldfilename newfilename // interactive copy CP /EXPORT/HOME/keven/ok.txt /export/HOME/Wing/test.txt cp -ri / export / home / ken / export / home / wing whole directory Copy the CP -RP file attribute together

CRONTAB Direct Logs Window Interface # crontab -l root // View Job /etc/init.d/cron stop // Stop Process in Console Mature Command crontab -e root crontab -e root // Edit Add to execute code 0- 59 * * * * Date >> /Export/HOME/keven/keven.txt // Add a secondary line at the end, execute once every minute

"The format is as follows: (1) (2) (3) (4) (5) (6) 0 0 * * 3 Date >> /Export/Home/keven/keven.txt 1. Minute (0-60) 2. Hours (0-23) 3. Day (1-31) 4. Month (1-12) 5. Week (0-6) 6. The program to run is as 1-59 minutes, 1-24 hours

0 18-23 0 0 0 0-6 / / Performed 18-23 points per day, 0-6 is Sunday Saturday

/etc/init.d/cron start // Startup Process # crontab -l root View Homework to join the execution queue. If you don't quit to the landing interface, log in again, and load it on Reboot

Are you directly editing the user's cron file? If it is of course not running, Cron Demon reads a configuration file when starting. If you are the next Job, use crontab -e to edit the user's cron. Do you want Your kill -hup cron process ID. Restart this process. You must write 5, 15, 20, 25, 30, 35, 40, 45, 50, 55 * * * * ====== every 5 minutes. ============================== "format is as follows: (1) (2) (3) (4) (5) (6 0 0 * * 3 / usr / bin / updatedb 1. Minute (0-60) 2. Hours (0-23) 3. Day (1-31) 4. Month (1-12) 5. Week (1- 7) 6. The procedure to run but I am set into 1 0 0 0 0 / USR / BIN / PS hopes to automatically display the process after a minute. But there is no success. Help Me

=============================================== 15 1 * * * /opt/bin/ta.sh / opt / aadir> / dev / null

Here> / dev / NULL must be used? What does it mean? Output redirection to / dev / null, otherwise mail to your mailbox dev / null is a special file, all data input to the file will be discarded. > / dev / null means discarding all output content, otherwise (just like the brother above) will send the output content to the user's mailbox executing the command. This kind of writing can only be sent to / dev / null if there is an error, or it will be sent to the mailbox. The following will discard all output content: 15 1 * * /opt/bin/ta.sh / opt / aadir> / dev / null 2> & 10 14 * * 0-6 // Performed 14 pm daily

LS $ ls -n total 12 -RW-R - R - 1 0 1 247 October 2 07:53 List -RW-R - R - 2 1002 100 62 October 2 01:10 Ok.txt DRWXR -xr-x 2 0 1 512 October 1 21:27 SS -RW-R - R - 1 1002 100 171 October 3 01:10 Test.txt -RW-R - R - 1 1002 100 120 October 2 20:54 TEST1 -RW-R - R - 1 1002 100 June 30 08:54 TEST2 -RW-R - R - 1 1002 100 Jul 30 08:54 Test3 -RW- R - r - 1 0 1 247 October 2 07:58 TT.TXT

# ls -ld using_samba // View directory permissions DRWXR-XR-X 2 root other 512 May 8 22:23 USING_SAMBA

$ ls -a. .cshrc list ss test1 test3 .. .login ok.txt test.txt test2 tt.txt

$ ls -l total 12 -RW-R - r - 1 root other 247 October 2 07:53 List -RW-R - R - 2 Keven User 62 October 2 01:10 ok.txt drwxr- XR-X 2 Root Other 512 October 1 21:27 SS -RW-R - R - 1 KEVEN USER 171 October 3 01:10 Test.txt -RW-R - R - 1 KEVEN USER 120 10 Month 2 20:54 TEST1-RW-R - R - 1 Keven User 0 September 30 08:54 TEST2 -RW-R - R - 1 KEVEN USER SEPT 0 September 30 08:54 TEST3 -RW-R --R - 1 root other 247 October 2 07:58 TT.TXT

$ ls -f // list directory name TT_DB / KEVEN / TEMP / USER2 / WWW / COLE / LOST FOUND / USER1 / WING /

Symbol file type / folder * Executable file (NONE) no formatted file or ASCII file @Link

Such as: # ls -F accept * gsscred * metaset * i86 / // directory acctadm * halt * metastat * roleadd * add_drv * hostconfig * metasync * test.txt // ASCII cachefslog @ in.rlogind * mount * rtquery * cachefswssize @ link File in .routed * mountall * rwall * // executable

$ ls -r // recursive display.: tt_db keven Temp user2 www crale Lost Found USER1 WING

./cole: inetServices.txt services services.txt./keven: Dir test.txt

./keven/dir:

./lost Found: ./lost Found: Permissions denied

./TEMP: SO.TAR.GZ

./User1:

./User2:

./wing: aa dead.Letter Mywife.tar ok passwd.txt test

./wing/test:

./ww: $ ls. // Displays the current directory DIR TEST.TXT $ ls .. // Displays the parent directory of the current directory, support path representation, such as ~ TT_DB Keven Temp user2 www cool lost found user1 wing $ ls - I Test.txt Test1.txt // Node Check 64 Test.txt 65 TEST1.TXT

$ ls -il test.txt test1.txt 64 -rw-r - r - 1 keven sysadmin 27 October 12 17:27 Test.txt 65 -RW-R - R - 1 Keven Sysadmin 0 October 12 17:25 TEST1.TXT $ ls -ld // Only Display Directory DRWXR-XR-X 3 Keven Sysadmin 512 October 12 17:25.

FILE $ file passwd.txt passwd.txt: ascii text

LP $ lp ok.txt myfile test.txt $ lp -p evans1 test.txt // - Phase for printer Evans1 $ lpstat // Print queue status ln #ln file1 newfile #LN file1 directory / newfilename hard link #LN ~ / Book / Chap * / Home / BRAD creates a link for each CHAP file, pointing these links to the / home / brad directory If the file has multiple hard disk links to its hard disk, just deleting the file does not effectively release the disk space, You will have to delete all hard links pointing to it.

#LN -s src target is a soft link, the store is just a path, can be seen with ls -l, if the original file has been removed or deleted, the name is not used, delete and the name of the link also use RM.

If the file has multiple hard disk links to its hard disk, just delete the file does not effectively release the disk space, you will have to delete all the hard links pointing to it.

# ln -s / export / home / ddd / var The / VAR is connected to / VAR under the VAR below to generate a DDD link symbol below. When / var is full

MV #MV -I OldFileName NewFileName Renaissible Document or Folder #mv -i source_file (s) target_directory mobile files to other directories

Swap # swap -s // lists a summary of a system virtual switching space.

Total: 25728k Bytes Allocated 6140k Reserved = 31868K USED, 56496K Available

# swap -l // List the detailed description of the physical switching space of the system. Swapfile Dev Swaplo Blocks Free / DEV / DSK / C0T3D0S1 32, 28 8 98792 90384

VMSTAT / / View Virtual Memory Status # Vmstat Kthr Memory Page Disk Faults CPU RBW SWAP Free Re Mf Pi Po fr de SR CD F0 S0 - in Sy CS US Sy ID 0 0 0 635012 40880 10 36 21 0 1 0 231 3 0 0 0 116 287 184 1 99 # vmstat -s 0 swap INS 0 SWAP OUTS 0 PAGES SWAPPED IN 0 PAGES SWPPED OUT 84899 TOTAL Address Trans. Faults Taken // Addresses Error 5916 Page INS 6 Page Outs 12283 Pages Paged in 9 paged out 22759 total reclaims 22759 reclaims from free list 0 micro (hat) faults 84899 minor (as) faults // small error 5186 major faults // major error 16092 copy-on-write faults // write the copy operation error 22331 zero fill page faults 539644 pages examined by the clock daemon 18 revolutions of the clock hand 570 pages freed by the clock daemon 550 forks 17 vforks 514 execs 431543 cpu context switches 272891 device interrupts 105553 traps 671500 system calls 97227 total name lookups (cache hits 96%) 1297 User CPU 1388 System CPU 230813 IDLE CPU 1542 WAIT CPU #

MPSTAT // System Load CPU and other information # mpstat 5 // Refresh every 5 seconds CPU Minf Mjf Xcal Intr ITHR CSW ICSW MigR SMTX SRW SYSCL USR SYS WT IDL 0 32 2 0 114 68 181 5 0 1 0 263 0 1 1 98 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 99 52 158 1 0 0 0 48 0 0 0 100 0 22 0 0 102 56 164 1 0 0 0 136 0 0 0 100

Cal # CAL 2004 May Day, two three four five six 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 25 26 27 28 29 30 31

# CAL 12 2002 // Show the 2002 calendar 2002 December 2002 Day 1233456 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

# Date; uname // Combination command, intermediate; separated from Wednesday, May 19, 2004 22 05 minutes 23 seconds CST Sunos

Redirect input / output #command> filename // If the file name exists, it will be overwritten, there is no existence to add #command >> filename // to an existing file (add to the end of the file), not Cover it, if you don't exist. #command 2> filename // Redirect standard error, create a file or overwrite the original file #commanf 2 >> filename // redirect standard error, add an existing file (added to the end of the file), not Cover it, if you don't exist. Construction OK file write: Cole how are you $ write

Find #find. -name test.txt // Search Current Directory #find Dir -Name Test.txt #find / -Name Test.txt #find / Export / Home -Name Test.txt #find ~ -name '* TIF' // User's home directory #find / export -name core -exec rm {} / // Search Core files and delete them #find dir -type d // file type #find / export -type d -name test // file Getting a 512Byte = 1 block of the Test #Find / Export -Size 400 // file greater than 400 blocks #find / export -name test.txt -exec rm {} /; // Find and delete #FIND / EXPORT -NAME Test.txt -ok rm {} /; // Interactive mode delete y #find / export -user keven // Find #find / -user uid -exec rm {} /; // to find the user's files and delete #find / -name pfile -print> find.txt 2> null.txt & // Find to find Find.txt, otherwise put it in the null.txt program in the background

# Find / export -name tex.txt -exec rm {} /; // {} / with a space $ find ~ -name '* es' // es in front of any character

Search expression meaning Definitions Name FileName file name Search all given files, you can accept metammatics (such as? *) Type FileType file type Search Match a file (D is a directory) MTIME [ | -] n Modified Time Search All modifications or files of file atime [ | -] n access to the given time search all access times or more, or less than, or less than a given time file user loginid -Group GroupID user ID and Group ID Search All file perm mode privileges of all matching IDs or group IDs Search all files matching the given permissions (only eight-in-one mode) Size [ | -] n [c] Search all sizes or greater than, A file smaller than n, n with 512 bytes per piece, if there is an AC, then calculate the -print base with the search result to the standard output. This result is a list of file names for full path names.

-EXEC Command {} /; EXEC option must be terminated by /; this makes the find command can be applied to each file given in the search criterion in the specified command - OK Command {} /; -EXEC's interaction format. This option Used to request input commands from the user. If rm -i -ls prints the current path using a long list format. This expression is most commonly used for linking an output, redirect it into a file, in order to check #grep root later / etc / passwd // Find root #grep -i root / etc / passwd // ignore the case #Grep -v root / etc / passwd // except ROOT # GREP-C Root Group // How many lines of statistics have

# GREP -L ROOT Passwd Group Hosts // File file Passwd Group included in the file

Regular expression function example results. (DOT) Matching any character can be used multiple times, similar to the LS command grep chap .. file display all the rows containing the CHAP, and there are two characters in the mode match 0 Or multiple characters grep chap * file display all containing chap, and then can be any character / (back slash) telling the shell Filled Dollar / * file display all the rows containing Dollar *. / Tell SHELL Filmly Message *, not wildcard ^ (CARET) matches all lines of all lines of fingers in the specified mode, showing all row $ 800 File at the end of the specified mode with all lines $ 800 file display All lines of NAME FY $ 800 File display all 800 The end of the line [] A character GREP [64.128] in the matching mode shows all line-I ignore the upper and lower-V-V containers containing 64MB or 128MB. In addition to the string

Egrep # egrep 'n (e | o)' / etc / passwd // looks back to the beginning of the letter L. E or O Listen: x: 37: 4: NetWork Admin: / USR / NET / NLS: Nobody: x: 60001: 60001: Nobody: /: NoAccess: x: 60002: 60002: No Access User: /: Nobody4: x: 65534: 65534: Sunos 4.x NoBody: /:

$ EGREP '(Network | UUCP) Admin' / etc / passwd uucp: x: 5: 5: uucp admin: / usr / lib / uucp: nuucp: x: 9: 9: uucp admin: / var / spool / uucppublic: / usr / lib / uucp / uuCico Listen: x: 37: 4: Network admin: / usr / net / nls:

Sort #cat test.txt ogg aaa ddkk ddgfg KK 11 34 22 #Sort Test.txt 11 22 34 AAA DDGFG DDKK KK OGGG # ls -ld t *> list # cat list -rw-r - r - 1 keven User 32 October 2 07:51 Test.txt -RW-R - R - 1 Keven User 0 September 30 08:54 Test1 -RW-R - R - 1 Keven User 0 September 30 08:54 Test2 -rw-r - r - r - 1 KEVEN USER JAN 200 08:54 TEST3 # sort -rn 4 list -o tt.txt // 翻 排 排头 4 characters # ls list ok.txt ss test.txt Test1 Test2 Test3 TT.TXT # Cat Tt.txt -RW-R - R - 1 Keven User 32 October 2 07:51 Test.txt -RW-R - R - R - 1 KEVEN USER SEP 2008 08 : 54 TEST3 -RW-R - R - 1 KEVEN USER S SEEM 2008 08:54 TEST2 -RW-R - R - 1 Keven User July 30 08:54 TEST1 #Sort 5M 6N List -o Up.txt option Description -N performs digital sorting, N can be connected separately and short lines, or can start or end or end in the area of ​​the nth separator ( | -) n. The default split is the order of space -R flip sorting. R can be used separately from short horizontal lines, or can follow a regional parameter -F to ignore the three characters that start the case nm in the arrangement to sort-D, use the dictionary, only the letter and space Sort, other symbols ignore -o filename put all output in the file name

WHO # WHO ROOT CONSOLE October 2 19:23 (: 0) WING PTS / 2 October 2 19:22 (192.168.0.1) (remote login)

# who -q // Log in user statistics root wing # users = 2

# WHO -R / / Run level. Run-level 3 October 2 19:20 3 0 s

$ WHO-Hu Name Line Time IDE PID Comments Keven PTS / 2 October 12 10:57. 389 (192.168.0.1) User PTS / 3 October 12 10:16 0:52 368 (192.168.0.1) PID Log in The process, # kill -9 368 kicks this user

$ WHO ROOT CONSOLE October 3 19:21 (: 0) Keven PTS / 6 October 3 22:11 (192.168.0.1) WING PTS / 2 October 3 22:11 (192.168.0.1) Cole PTS / 3 October 3 22:11 (192.168.0.1)

W $ w at 11:01 in the afternoon 3:43, 4 Users, average load: 0.00, 0.00, 0.02 User name terminal login time idle JCPU PCPU execution command root console at 7:21 pm 3:40 10 1 / usr / DT / BIN / DTSCREEN -MODE Blank Keven PTS / 6 11:11 PM - CSH WING PTS / 2 at 10:11 PM 5 w Cole PTS / 3 PM Ethm 10 - KEVEN 11:10 pm Run 3:52, 4 users, average load: 0.00, 0.00, 0.02 Username terminal number login time idle JCPU PCPU execution command keven PTS / 6 at the aftest] 9-Cshlogins # logins root 0 Other 1 Super-user daemon 1 other 1 bin 2 bin 2 sys 3 sys 3 adm 4 adm 4 Admin uucp 5 uucp 5 uucp Admin nuucp 9 nuucp 9 uucp Admin smmsp 25 smmsp 25 SendMail Message Submission Program listen 37 adm 4 Network Admin lp 71 lp 8 Line Printer Admin wing 1001 ADM 4 My Wife Keven 1002 USER 100 USER1 1003 ADM 4 User2 1004 ADM 4 Cole 1005 ADM 4 Nobody 60001 Nobody 60001 Nobody No Access 60002 NOACCESS 60002 No Access User Nobody4 65534 NOGROUP 65534 Sunos 4.x Nobody

Last $ last // Current system usage history usage model keven PTS / 2 192.168.0.1 Mon Oct 6 00:55 is still logging in State Cole PTS / 6 192.168.0.1 Mon Oct 6 00:52 is still logging in ROOT Console: 0 Mon Oct 6 00:44 is still logging in State Wing PTS / 3 192.168.0.1 Mon Oct 6 00:21 is still logging in State Keven PTS / 2 192.168.0.1 Mon Oct 6 00:21 - 00:55 (004) Reboot System Boot Mon Oct 6 00:20 Keven PTS / 2 192.168.0.1 Sun Oct 5 19:47 - 20:02 (00:14) Reboot System Boot Sun Oct 5 19:46 WING PTS / 1 192.168.0.1 Sun Oct 5 07 : 47 - 07:48 (00:00) Keven PTS / 1 192.168.0.1 Sun Oct 5 06:24 - 07:47 (01:23) Root Console: 0 Sun Oct 5 06:22 - 07:48 (01: 25) KEVEN PTS / 1 192.168.0.1 Sun Oct 5 06:21 - 06:24 (00:02) Reboot Sun Oct 5 06:21 Cole PTS / 6 192.168.0.1 Sun Oct 5 01:58 - 03:09 (01:11) WING PTS / 5 192.168.0.1 Sun Oct 5 01:58 - 03:10 (01:11)

Finger # finger login name tty idle by the user login name tty idle when the user is viewed by the user login name.......................................... Keven Admin PTS / 6 11 Fri 22:11 192.168.0.1 $ finger @www // View a host login user status WWW for host name [www] login name tty idle when root super-user console 1 fri 19:21 : 0 keven admin PTS / 6 13 Fri 22:11 192.168.0.1 #finger -s username @ hostname #finger @ Webserver.com #finger username@webserver.com $ finger -l keven // long format display login name: keven in Real life: admin Directory: / bin / keven shell: / bin / ksh on Since Oct 12 10:16:41 on PTS / 2 from 192.168.0.1 24 seconds idle time no unread mail no plan. # Finger User1 login name : User1 in real life: Directory: / Export / Home / Wing shell: / bin / sh on Since Oct 12 11:11:33 on PTS / 3 from 192.168.0.1 4 Minutes 8 Seconds Idle Time No Unread Mail No Plan. $ Finger -m // only search for the username of the landing

#man -l uname // Output The address of this command uname (1) -m / usr / share / man uname (2) -m / usr / share / man

Name Man - FIND AND DISPLAY REFERENCE

Synopsis man [-] [-adflrt] [-m path] [-t macro-package] [-s section] name ...

MAN [-M Path] -k keyword ...

MAN [-M PATH] -F File ...

ID # id uid = 0 (root) GID = 1 // is the ID of the current user, not the original landing ID

Who I am # Who I am // Real Uid Root Console Oct 2 19:23 (: 0) WING PTS / 2 OCT 2 19:41 (192.168.0.1)

DF -K # DF-K FileSystem Kbytes Used Avail Capacity Mounted ON / DEV / DSK / C0D0S0 63127 36137 20678 64% / / DEV / DSK / C0D0S6 1201014 768820 372144 68% / USR / Proc 0 0 0 0% / proc MNTTAB 0 0 0 0% / etc / mnttab FD 0 0 0 0% / DEV / FD / DEV / DSK / C0D0S3 55047 25063 24480 51% / VAR SWAP 608948 24 608924 1% / VAR / Run SWAP 609216 292 608924 1% / TMP / DEV / DSK / C0D0S5 24239 15 21801 1% / OPT / DEV / DSK / C0D0S7 2691830 112 2637882 1% / Export / Home / DEV / DSK / C0D0S1 462639 306816 109560 74% / USR / OpenWin du -k #du -k / Export // Recursive Display Files or Folders # du -sk / etc  View Directory Total Total Tree Statistics # du -k / etc | Sort -n can be quickly I found that the directory is the biggest. VI VI (Text Input Mode) Command Function A After the cursor, add text a, add text a in the row, add text o before the cursor, add text o to insert a new line VI (last line mode) command function: W Write buffer, save changes Continue to work in VI: w new_filename writes the buffer like a new_filename: WQ or ZZ write buffer, save the modification, then exits VI: Q! Do not save your modification: WQ! Write buffer save modification and then launch vi, if you It is the owner of the file to ignore the read-only attribute E! Cancel the modification of the previous preservation: WQ! WQ u cancel the nearest editor

VI (Command Mode) Command function j (or down arrow) Move down a row of K (or upward arrow) Move up the H (or the left arrow) moving a character L (or right arrow) moving forward one Character space moves a character W. Moves a word (including punctuation) B backward, moves a word (including punctuation) $ moving to the end of the row 0 (zero) or ^ moving to the first bus to move to the next line

VI (Command Mode and Live Mode) Command Function x (lowercase) Delete Cursor Character DW Delete Word 3DW Delete Three Word DD Delete Cursor The row of 3DD Delete Three lines YY Pull out, put it in the clipboard P ( Small write) Put the line out of the current P (uppercase) Pull the line to the current: SET NU Display line number: SET NONU hide line number: SET SHOWMODE Displays the current mode of operation (if using versions will be automatically opened): Set NoshowMode Close Mode Display: Set Display All VI Variables: Set All Displays all possible VI variables and their current value G to the last line of the file: 21 arrive at the 21st row / String forward Search string string? String Search String String n Find the next string of the match

CPIO

#CPIO -IDCMV

Tar # tar cvf backup.tar list ok.txt test.txt // Backup Generation Backup.tar a list 1k a ok.txt 1k a test.txt 1k #tar rvf backup.tar tt.txt // Add TTT.TXT to Backu.tar to # TAR CVF backup.tar tt.txt // Note will overwrite Backup.Tar original file a tt.txt 1k # tar cvf /export/HOME/Wing/mywife.tar ok2.txt ss // Back up to another directory # tar xvf backup.tar // Restore #TAR XVF backup.tar tt.txt // Restore the specified file to TAR: block size = 4 x Tt.txt, 290 Bytes, 1 Tape Blocks # TAR TVF backup.tar / / View the compressed file name, did not decompress TAR: block size = 4 -rw-rw-rw- 1002/1 290 2003 October 3 02:10 TT.TXT $ TAR Uf myarch myDir // TAR will compare the recent update time of each archive file and the file in the user directory, and copy any files changed since the last archive to the archive.

Parameter Description c Create a new TAR file T list the contents of the tar file X From the TAR file to extract the specified file R to add a new file to the existing tar file into the f-specified file name v Detailed mode m will be from one Don't give it a new timestamp when you extract a file in your file.

Compress # compress -v kk.txt mm.txt kk.txt: Compressed: 58.18% - Replace // Note The original file will be replaced by .z MM.TXT: Compressed: 1.33% - Replace # ls err.txt kk.txt.z mm.txt kk.txt.z mm.txt.z tt.z mm.txt.z tt.z // Unzip, pay attention to the original .z file will be OK2.txt Alternative # uncompress -c test1.z | more // just view the content of the file, no decompression

Zip #zip Winzip Test1.txt Test2.txt // Generate Winzip.zip file #unzip WinZip.zip // Decompression

Gzip # gzip -v Test2 Test3 Test2: 0.0% - Replaced with test2.gz // Note the original TEST3: 0.0% - Replaced with test3.gz # ls test2.gz test3.gz

Gunzip #gunzip Test2.gz

Gzcat #gzcat tt.txt.gz -rw-r - r - 1 keven user 32 October 2 07:51 Test.txt -RW-R - R - 1 KEVEN USER SEP 2008 08:54 TEST3 -rw-r - r - 1 keven user 0 September 30 08:54 TEST2 -RW-R - R - 1 KEVEN USER SEEM 2008 08:54 Test1

User and Permissions CHMOD #CHMOD U R Test.txt #chmod Go RW Test.txt #chmod OW Test.txt #chmod 555 Test.txt #chmod T DIR // Adhesive Tape Permissions #CHMOD G S File. TXT // setuid #chmod u s file.txt // setgid

Chown #chown new_owner filename #chown -r new_owner directoryName

Chgrp #chgrp new_group filename #chgrp -r new_group filename nice #nice -20 dtterm // Priority increase to 20 value, the higher the priority, the higher the #NICE --20 DTTERM // Priority Decrease to 20Groups $ groups // Show you Group ADM $ groups root // Shows what group belonging to what group Other root bin sys adm uucp mail tty lp nuucp daemon

NewGRP $ newgrp adm // Switch to other groups

umask% umask 22 start permission - I want to get the permissions = umask value

UserAdd # useradd user3 # uSERADD -U 1006 -G 4 -d / export / home / user3 -s / bin / sh -c "web user" user3 // complete add users #useradd -u 1006 -g 4 -d / Export / Home / User3 -M -S / BIN / SH -C "Web User" User3 // Create a user while creating a primary directory file

Parameter Description -C Records for each user, record the personal information of each user - D user main directory path - M used to create the user's home directory, usually with the -d path name with -g user's default group -g The user's default gid -e account is no longer valid, usually uses the maximum number of idle days of -f licensed users in creating a temporary account, and uses the UID -S user of the -u user when creating a temporary account.

Userdel # userdel user7 // removes USER7, but does not delete the directory # ouncedel -r username // delete the main directory together

Usermod # usermod -u 1005 -c Adminisrator Cole / / Modify Some Information # uSERMOD -G Group1, Group2 UserName // Add users to multiple groups # usermod -g sys, sysadmin cole # groups cole mail sys sysadmin # usermod -g Apache Cole // Main group # groups cole apache

PASSWD #passwd -f user // Forced changes to change password #passwd user // next time you log in #passwd -l user // lock users can not log in #passwd -x 30 user // password valid for 30 days # Passwd -w 3 USER // The first 3 days of password failure reminds users to modify

GroupAdd # groupAdd -g 2000 Usergroup

Groupdel #groupdel groupname

Groupmod #groupmod -n newname oldname #groupmod -g gid groupname / / modified its gid # country od -g gid -n newname oldname

Process management

PS

Field Overview: F hex binary logo, they add up to the current state of the process. The 00 process is terminated as described below, and their space in the process table has been released. 01 System Process, long-standing memory 02 Process is tracked by the parent process tracking 04 and has been stopped 08 The process cannot be woken up by the signal amount. This process is currently in memory, and is locked until an event completed 20 processes cannot be Exchange out

The current state of the process, displayed by one of the following letters: o is currently running S sleep on the processor; waiting for the I / O event to complete R run end I idle; process is created Z zombie. The process has terminated TA to stop X wait for more memory UID Process Owners' user ID PID Process ID PPU usage (ie, the process accounts for the percentage of CPU time) PRI process priority program . The larger number represents the NICE value of the lower priority NI process, which is associated with the priority scenario. Make a process "NICER" means the priority of the process so that it does not use the virtual memory requested by the time SZ process of the CPU. This is a good indicator of the system on memory requirements. Tty startup process (or parent process) terminal. Process No Connection Terminal (Usually System Process) Time Since the Process Starting COMD COMD Generation Process # Ps -f Uid Pid Ppid C Stime Tty Time CMD KEVEN 360 358 0 19:19:19 PTS / 2 0:00 -CSH KEVEN 477 360 0 19:28:14 PTS / 2 0:00 ps -f # ps -u wing // Specific user PID TTY TIME CMD 368 PTS / 3 0:00 sh # Ps Pid Tty Time CMD 360 PTS / 2 0:00 CSH 475 PTS / 2 0:00 PS # ps --e pid Tty Time CMD 0? 0:01 Sched 1? 0:00 INIT 2? 0:00 Pageout 3? 0:00 fsflush 328? 0:00 SAC 331? 0:00 TTYMON 153? 0:00 rpcbind # ps -ecl // PRI is a process priority, here 98 is the highest fs Uid PID PPID CLS Pri Addr SZ WCHAN TTY TIME CMD 19 T 0 0 0 SYS 96 FEC287CC 0? 0:00 SCHED 8 S 0 1 0 TS 59 D7A8808 319 DEA06E16? 0:00 Init 19 s 0 2 0 SYS 98 DE7A8108 0 FEC4D4B8? 0:00 Pageout 19 s 0 3 0 SYS 60 DE7A7A08 0 FeCea0BC ? 0:01 FSFLUSH 8 S 0 329 1 TS 59 DE7A7308 448 DEAC8D68? 0:00 SAC 8 S 0 256 1 TS 59 DE7A6C08 1084 DEEB7F02? 0:00 Sendmail

$ ps -eaf uid pid ppid c stime tty time cmd root 0 0 0 19:18:44? 0:01 Sched Root 1 0 0 19:18:44? 0:00 / etc / init - root 2 0 0 0 19: 18:44? 0:00 Pageout root 3 0 0 19:18:44? 0:00 fsflush root 328 1 0 19:19:10? 0:00 / usr / lib / saf / sac -t 300 root 331 328 0 19:19:10? 0:00 / usr / lib / saf / ttymon root 153 1 0 19:18:53? 0:00 / usr / sbin / rpcbind

#ps -eaf | grep wing root 317 1 0 19:19:10? 0:00 / usr / lib / dmi / snmpxdmid-y wing root 329 1 0 19:19:10 Console 0:00 / usr / lib / sa / TTYMON -G-H -P WING Console Login: -t sun-color -d / dev / console wing 368 366 0 19:19:47 PTS / 3 0:00 -SH usage: ps [-aadeflcjlpy] [-o Format] [-t item list] [-u user list] [-u user list] [-g Group list]

[-p proClist] [-g pgrplist] [-s sidlist] option Function PS No Options Display User Process Information in Current Shell and Terminal Window Ps -e Every Every Display Information PS -F FULL Generate A long list showing all available information of each process PS -U Userid User Displays all processes for specific users $ ps -u wing // wing for the username PID TTY TIME CMD 368 PTS / 3 0:00 SH 494 PTS / 3 0:00 ps $ ps -u wing pid tty time cmd 368 PTS / 3 0:00 SH 495 PTS / 3 0:00 PS $ ps -g user // user is a group name PID TTY TIME CMD 360 PTS / 2 0 : 00 csh

# priocntl -l configured classes ==================

SYS (SYSTEM CLASS) system

TS (TIME Sharing) Share Configured TS User Priority Range: -60 THROUGH 60

FX (Fixed Priority) Configured FX User Priority Range: 0 THROUGH 60

IA (Interactive) Interaction Configured IA User Priority Range: -60 THROUGH 60 For class-form sharing level, the user provides the priority range: -20 ~ 20

# ps -ecl f s uid ppid cls pri addr sz wchan tty time cmd 19 t 0 0 sys 96 fec287cc 0? 0:00 SCHED 8 S 0 1 0 TS 59 DE7A8808 319 DEA06E16? 0:00 init

PGREP / / View Process # pgrep -lf inetd 616 / USR / SBIN / INETD -S -T

$ PGREP -L LP 217 LPSCHED

Kill

Signal: 1 Pause 2 Interrupt 3 Exit 4 illegal instruction 5 Tracking Interrupt 6 Abort 7 EMT Directive (Emulation Competitive Trap) 8 Floating-Point Format NOWER 9 KILL (cannot be captured or ignored) 10 channel error 11 illegal memory section 12 Error System Call 13 Writing Unreadable Pipe 14 ALARM CLOCK 15 Software End Signal 16 User-defined Signal 1 17 User-defined signal 2 18 Sub-process state is changed 19 Power supply broken 20 windows (window) size is changed 21URgent (Emergency) Socket Condition 22 POLLABLE (inquiry) Event 23 Stop 24 User Termination 25 Continue to Perform 26 Stop Terminal Enter 27 Stop Terminal Output 28 Virtual Timer Expired 29 Profiling Time Expired 30 More than CPU Time 31 More than File Size 32 Socket I / O Possible # kill -9 368 // Forced killing a process #kill 368 // kills a process, use 15 as the default value, restart a process for soft kill -hup ID //

$ SLEEP 500 & $ JOBS [1] Running Sleep 500 $ SLEEP 500 ^ z [1] Stopped Sleep 00 $ JOBS [1] Stopped Sleep 500 $ BG% 1 [1] Running Sleep 500 $ KILL% 1 [1 ] Terminated Sleep 500 $ JOBS $

Java # Java -Version Java Version "1.4.0_03" Java (TM) 2 Runtime Environment, Standard Edition (Build 1.4.0 Java Hotspot (TM) Client VM (Build 1.4.0_03-B04, MIXED MODE)

Proc tool

$ ps pid tty time cmd 806 PTS / 3 0:00 PS 368 PTS / 3 0:00 sh $ pflags 368 368: -sh data model = _ilp32 flags = pr_orphan / 1: flags = pr_pcinval

% PMAP 823 // process address space allocation, and library required to execute 823: -CSH 08043000 20K rw --- [stack] 08050000 128K RX - / USR / BIN / CSH 08070000 12K RWX - / usr / bin / CSH 08073000 68K RWX - [HEAP] DD9C0000 8K RX - /USR/LIB/LOCALE/ENZH_EN_CN.GB18030/Methods_ZH_CN.GB18030.SO.2 DD9D1000 4K RWX-- /usr/lib/locale/en_en.gb18030/methods_zh_cn. GB18030.SO.2 DD9E0000 324K rx - /usr/lib/locale/en_cn.gb18030/en_cn.gb18030.so.2 DDA40000 8K rwx - /usr/lib/locale/en_cn.gb18030/en_cn.gb18030.so. 2 DDA60000 4K rwx - [Anon] DDA70000 628K RX - /USR/LIB/LIBC.SO.1 DDB1D000 24K rwx - /usr/lib/libc.so.1 DDB23000 4K RWX - / USR / LIB / LIBC .sso.1 DDB30000 152K RX - /USR/LIB/LIBCURS.SO.1 DDB66000 28K rwx - /usr/lib/libcurses.so.1 DDB6D000 8K rwx - /usr/lib/libcurses.so.1 DDB80000 4K rx - /usr/lib/libdl.so.1 ddb90000 292k rx - /usr/lib/ld.so.1 DDBE9000 16K rwx - /usr/lib/ld.so.1 ddbed000 8K rwx - / USR / LIB / LD.SO.1 TOTAL 1740K $ PLDD 830 / / Dynamic library list 830: -sh /usr/lib/libgen.so.1 /usr/lib/libc.so.1 / USR / LIB / LIBDL.SO.1 /usR/LIB/LOCALE/EN_CN.GB1803 0 / zh_cn.gb18030.so.2 /usr/lib/locale/en_cn.gb18030/methods_zh_cn.gb18030.so.2

$ Psig 830 // associated with a process signal list 830: -sh HUP caught done 0 INT caught 0x8059a30 0 QUIT caught 0x8059a30 0 ILL caught done 0 TRAP caught done 0 ABRT caught done 0 EMT caught done 0 FPE caught done 0 KILL default Bus caught done 0 segv caught 0x8059f70 onstack, siginfo

$ PSTACK 830 // View process stack tracking in hexadecimal format 830: -sh ddacedf7 waitid (0, 353, 8047d40, 83) DDAEEEA7 _WAITPID (353, 8047df8, 80) 66 DDB30581 Waitpid (353, 8047df8, 80) 21 08062319 ???????? (8078C44) 08062CEF PostJob (353, 1) CE 0805D1E9 Execute (8079374, 0) 801 08055B61 ???????? (0) 080559B5 Main (1 , 8047EB4, 8047EBC) 4D9 08055427 ???????? ()

$ pfiles 830 // All files opened by each process 830: -sh current rlimit: 256 file descript rlimit: 256 File Descriptors 0: S_IFCHR MODE: 0620 Dev: 102, 0 ino: 853 Uid: 1001 GID: 7 RDEV: 24, 2 O_RDWR 1 : S_IFCHR MODE: 0620 dev: 102, 0 ino: 853 Uid: 1001 GID: 7 RDEV: 24, 2 o_rdwr 2: S_IFCHR Mode: 0620 Dev: 102,0 ino: 853 Uid: 1001 GID: 7 RDEV: 24, 2 O_RDWR $ PWDX 830 // Gets the current working directory 830: / export / home / wing $ ptree 830 // Get the relationship between the parent process and sub-process 179 / usr / sbin / inetd -s 828 in.telnetd 830 -SH 854 PTREE 830

LSOF Tool - Need to download and install, there is no self

Software Management Pkgadd #Pkgadd -d / Tem SoftwareName Software Name GPW-6.94-Sol8-Intel-local.gz #gunzip GPW-6.94-Sol8-Intel-local.gz # HEAD GPW-6.94-Sol8-Intel-local.gz / / View file version information #pkgadd -d gpw-6.94-sol8-intel-local.gz install #install -c / opt / scripts -m 0755 -u bin -g sysadmin / tmp / setup_script // target path permission user group Source path pkginfo #pkginfo // installed package PKGCHK #PKGCHK PKGINST // Check the integrity of the package #PKGCHK -F PKGINST // Hand package problem #Pkgchk -n pkginst // ignore the instability #PKGCHK -l -p / usr / bin / mydir // Get the package properties of the installed file pkgrm #pkgrm pkginst // delete package #pkgrm pkginst1 pkginst2 // delete multiple packages showrev #ShowRev -p // Display installed installed patch

PATCHADD #PATCHADD PATCHNAME / / Installation Patch #patchadd -m Patch1 Patch2 / / Install Multiple Patch #patchadd -d -r / Export / Mars / Var / Spool / Patch / 11102-12 // Domestic Path // Not Allow Field recovery for patch installation

Patch installation example 2.6_recommended.tar.z patch name 1 #df -k dir // View the size of the directory #TAR XVF 2.6_Recommended.tar.z #. / Install

Parameter function -b Specifies the directory where the store is restored, not the default directory -c If necessary, specify the path to the network installation image that needs to be patch-not accepting the patch installation of the recoverable site -M specified positioning patch Directory -P Print All Installed Patch List - U Do not allow file installation to take effect - REstened specified optional root directory -S from the server to client installation patch, client sharing server operating system catalog

Patchrm #patchrm patchname // Remove patch #patchrm -c /export/solaris_2.9/tools/1065-15 // Delete patch from the client system

Boot and startup process, OK mode #Shutdown #Reboot #init 0 #boot -r

OK STENV Boot-Device Disk // Change the default startup device to disk boot-device = disk

Ok Printenv Boot-Device // Upmit Start Device Boot-Device Disk Disk

OK RESET

OK test net // Test loop network device OK Watch-clock // Test Clock Device OK Boot -r // Reboot System OK Boot Net // Start OK Boot CDROM // From the CD Ok Boot FLOPPY / / Soft Pan Start OK Boot Tape // From Tape Boot System Ok Watch-Net // Check that the network is Unicom OK Probe-SCSI // All disk devices detected, and get available devices list ok banner // detect memory, system firmware OpenBoot version information OK boot -s // Enter single user mode #Reboot -l - -r // Reboot Not in the system diary record #SHUTDOWN - I 0 -G 120 -Y #Sync; Init 0 #TraceRoute WWW. Abc.comwall #wall

init #init q // reinitialize #init 0 // hardware run level maintenance mode #init 1 // single-user mode is not available #init 2 // NFS #init 3 // NFS available #init 4 // user-defined state # INIT 5 // Turn off system power #INIT 6 / / hangs the operating system #init S // into the management status

Network Configuration

ETC / Hostname.Interface // is the name of this network card or the name of the machine # cat hostname.pcn0 Wing

# Cat Hosts # # Internet host table # 127.0.0.1 localhost 192.168.0.11 wing # Hostname Wing

# Cat Netmasks 192.168.0.0 255.255.255.0

#Ifconfig le0 172.16.255.1 Netmask 255.255.255.0

Configuring Network Port Status #ifconfig le0 UP / DOWN Configure whether the network port can be displayed with a #ifconfig le0 plumb / unplumb #Ifconfig -a This address is only displayed when the root user is used. If a non-root user uses ifconfig command, only IP addresses # ifconfig -a lo0: flags = 1000849 MTU 8232 Index 1 INET 127.0.0.1 Netmask FF000000 HME0: Flags = 1000843 MULTICAST, IPV4> MTU 1500 INDEX 2 INET 192.168.10.25 Netmask fffff00 Broadcast 192.168.10.255 Ether 8: 0: 20: A2: 11: DE #

#ifconfig le0 192.168.0.3 Netmask 255.255.255.0 Broadcast 192.168.0.255 Up banner You can also find the MAC address, CPU model, and frequency at the OK prompt when the system has not started. Ok Banner

UN Ultra 5/10 UPA / PCI (Ultrasparc-III 300MHz), Keyboard Present Openboot 3.1.1 64 MB Memory Installed, Serial # 9361102. Ethernet Address 8: 0: 20: 8E: D6: CE, Hostid: 808ed6ce.

# arp -a // Log in user

Net to Media Table: IPv4 Device IP Address Mask Flags Phys Addr ----------------------------------- ---- ------------------- PCN0 192.168.0.1 255.255.255.255 00:03: 0f: fd: 6d: 0c PCN0 Wing 255.255.255.255 SP 00: 0C: 29: 19: A1: 54 PCN0 224.0.0.0 240.0.0.0 SM 01: 00: 5E: 00: 00: 00 # NetStat // Network Status

TCP: IPv4 Local Address Remote Address Swind Send-q rwind Recv-q State -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------ ---------- ---------- ------- Winger.telnet 192.168.0.1.1030 7168 0 66608 0 Established Wing. Telnet 192.168.0.1.1032 6253 1 66608 0 ESTABLISHED

Active Unix Domain Sockets Address Type VNode Conn Local Addr Remote Addr DF187CC0 Stream-Ord Dee4c1C0 00000000 /TMP/.x11-unix/x0 DF187DE8 Stream-ORD 00000000 0000000 #

# netstat -r // View routing table

Routing Table: IPv4 Destination Gateway Flags Ref Use Interface ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ----- ---------- --------- 192.168.0.0 WING U 1 3 PCN0 224.0.0.0 WING U 1 0 PCN0 Default WING UG 1 0 Localhost Localhost UH 2 6 LO0

# netstat -g

GROUP MEMBERSHIPS: IPv4 Interface Group Refcnt -------------------------------- LO0 224.0.0.1 1 PCN0 224.0. 0.1 1

# netstat -p

Net to Media Table: IPv4 Device IP Address Mask Flags Phys Addr ----------------------------------- ---- ----- --------------- PCN0 192.168.0.1 255.255.255.255 00: 03: 0F: fd: 6d: 0c PCN0 Solaris9 255.255.255.255 SP 00: 0C: 29: 80: 4C: 0A PCN0 224.0.0.0 240.0.0.0 SM 01: 00: 5E: 00: 00: 00 #

# netstat -s

Rawip RawipinDataGrams = 0 RawipineRRORS = 0 RawipincksuMerrs = 0 RawipoutDataGrams = 0 RawipouterRors = 0

UDP udpindatagram = 923 udpinerrors = 0 udpoutdatagram = 928 udpouterrors = 0

TCP tcpRtoAlgorithm = 4 tcpRtoMin = 400 tcpRtoMax = 60000 tcpMaxConn = -1 tcpActiveOpens = 18 tcpPassiveOpens = 21 tcpAttemptFails = 0 tcpEstabResets = 0 tcpCurrEstab = 31 tcpOutSegs = 715 tcpOutDataSegs = 524 tcpOutDataBytes = 52210 tcpRetransSegs = 0 tcpRetransBytes = 0 tcpOutAck = 191 tcpOutAckDelayed = 90 tcpOutUrg = 0 tcpOutWinUpdate = 0 tcpOutWinProbe = 0 tcpOutControl = 47 tcpOutRsts = 0 tcpOutFastRetrans = 0 tcpInSegs = 925 tcpInAckSegs = 505 tcpInAckBytes = 52216 tcpInDupAck = 7 tcpInAckUnsent = 0 tcpInInorderSegs = 524 tcpInInorderBytes = 45645 tcpInUnorderSegs = 0 tcpInUnorderBytes = 0 tcpInDupSegs = 0 tcpInDupBytes = 0 tcpInPartDupSegs = 0 tcpInPartDupBytes = 0 tcpInPastWinSegs = 0 tcpInPastWinBytes = 0 tcpInWinProbe = 0 tcpInWinUpdate = 0 tcpInClosed = 0 tcpRttNoUpdate = 0 tcpRttUpdate = 497 tcpTimRetrans = 0 tcpTimRetransDrop = 0 tcpTimKeepalive = 0 tcpTimKeepaliveProbe = 0 tcpTimKeepaliveDrop = 0 tcpListenDrop = 0 tcpListenDropQ0 = 0 tcpHalfOpenDrop = 0 TCPOUTSACKRENS = 0

IPv4 ipForwarding = 2 ipDefaultTTL = 255 ipInReceives = 422 ipInHdrErrors = 0 ipInAddrErrors = 0 ipInCksumErrs = 0 ipForwDatagrams = 0 ipForwProhibits = 0 ipInUnknownProtos = 0 ipInDiscards = 0 ipInDelivers = 1832 ipOutRequests = 265 ipOutDiscards = 0 ipOutNoRoutes = 0 ipReasmTimeout = 60 ipReasmReqds = 0 ipReasmOKs = 0 ipReasmFails = 0 ipReasmDuplicates = 0 ipReasmPartDups = 0 ipFragOKs = 0 ipFragFails = 0 ipFragCreates = 0 ipRoutingDiscards = 0 tcpInErrs = 0 udpNoPorts = 20 udpInCksumErrs = 0 udpInOverflows = 0 rawipInOverflows = 0 ipsecInSucceeded = 0 ipsecInFailed = 0 ipInIPv6 = 0 ipOutIPv6 = 0 ipOutSwitchIPv6 = 8IPv6 ipv6Forwarding = 2 ipv6DefaultHopLimit = 255 ipv6InReceives = 0 ipv6InHdrErrors = 0 ipv6InTooBigErrors = 0 ipv6InNoRoutes = 0 ipv6InAddrErrors = 0 ipv6InUnknownProtos = 0 ipv6InTruncatedPkts = 0 ipv6InDiscards = 0 ipv6InDelivers = 0 ipv6OutForwDatagrams = 0 ipv6OutRequests = 0 ipv6OutDiscards = 0 ipv6OutNoRoutes = 0 ipv6OutFragOKs = 0 ipv6outfragfails = 0 ipv6outfragcr eates = 0 ipv6ReasmReqds = 0 ipv6ReasmOKs = 0 ipv6ReasmFails = 0 ipv6InMcastPkts = 0 ipv6OutMcastPkts = 0 ipv6ReasmDuplicates = 0 ipv6ReasmPartDups = 0 ipv6ForwProhibits = 0 udpInCksumErrs = 0 udpInOverflows = 0 rawipInOverflows = 0 ipv6InIPv4 = 0 ipv6OutIPv4 = 0 ipv6OutSwitchIPv4 = 0

ICMPv4 icmpInMsgs = 5 icmpInErrors = 0 icmpInCksumErrs = 0 icmpInUnknowns = 0 icmpInDestUnreachs = 5 icmpInTimeExcds = 0 icmpInParmProbs = 0 icmpInSrcQuenchs = 0 icmpInRedirects = 0 icmpInBadRedirects = 0 icmpInEchos = 0 icmpInEchoReps = 0 icmpInTimestamps = 0 icmpInTimestampReps = 0 icmpInAddrMasks = 0 icmpInAddrMaskReps = 0 icmpInFragNeeded = 0 icmpOutMsgs = 5 icmpOutDrops = 0 icmpOutErrors = 0 icmpOutDestUnreachs = 5 icmpOutTimeExcds = 0 icmpOutParmProbs = 0 icmpOutSrcQuenchs = 0 icmpOutRedirects = 0 icmpOutEchos = 0 icmpOutEchoReps = 0 icmpOutTimestamps = 0 icmpOutTimestampReps = 0 icmpOutAddrMasks = 0 icmpOutAddrMaskReps = 0 icmpOutFragNeeded = 0 icmpInOverflows = 0

ICMPv6 icmp6InMsgs = 0 icmp6InErrors = 0 icmp6InDestUnreachs = 0 icmp6InAdminProhibs = 0 icmp6InTimeExcds = 0 icmp6InParmProblems = 0 icmp6InPktTooBigs = 0 icmp6InEchos = 0 icmp6InEchoReplies = 0 icmp6InRouterSols = 0 icmp6InRouterAds = 0 icmp6InNeighborSols = 0 icmp6InNeighborAds = 0 icmp6InRedirects = 0 icmp6InBadRedirects = 0 icmp6InGroupQueries = 0 icmp6InGroupResps = 0 icmp6InGroupReds = 0 icmp6InOverflows = 0 icmp6OutMsgs = 0 icmp6OutErrors = 0 icmp6OutDestUnreachs = 0 icmp6OutAdminProhibs = 0 icmp6OutTimeExcds = 0 icmp6OutParmProblems = 0 icmp6OutPktTooBigs = 0 icmp6OutEchos = 0 icmp6OutEchoReplies = 0 icmp6OutRouterSols = 0 icmp6OutRouterAds = 0 icmp6OutNeighborSols = 0 icmp6OutNeighborAds = 0 icmp6OutRedirects = 0 icmp6OutGroupQueries = 0 icmp6OutGroupResps = 0 icmp6OutGroupReds = 0IGMP: 0 messages received 0 messages received with too few bytes 0 messages received with bad checksum 0 membership queries received 0 membership queries received with invalid field (s) 0 membership repor Ts Received 0 Membership Reports Received With Invalid Field (s) 0 Membership Reports Received for Groups to Which We Belong 0 Memberip Reports SENT

# netstat -m

Virtual Interface Table Is Empty

MultiCast Forwarding Cache IS EMPTY

#

# NetStat -r // Network interface status

Routing Table: IPv4 Destination Gateway Flags Ref Use Interface ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----- ---------- --------- 192.168.0.0 Solaris9 U 1 1 PCN0 192.168.0.0 Address2 U 1 0 PCN0: 1 224.0.0 Solaris9 u 1 0 PCN0 Default 192.168.0.1 UG 1 0 localhost localhost UH 2 6 LO0 # netstat -rn

Routing Table: IPv4 Destination Gateway Flags Ref Use Interface --------------------------------------------------------------------------------------------------------------------------------------------------------- ---- - ---------- --------- 192.168.0.0 192.168.0.3 U 1 1 PCN0 192.168.0.0 192.168.0.5 U 1 0 PCN0: 1 224.0.0.0 192.168.0.3 U 1 0 pcn0 default 192.168.0.1 UG 1 0 127.0.0.1 127.0.0.1 UH 2 6 lo0 ## netstat -i 1 5 input pcn0 output input (Total) output packets errs packets errs colls packets errs packets errs colls 1187 0 1318 0 0 3699 0 3830 0 0 0 4 0 0 0 0 0 5 0 0 0 0 0 4 0 0 5 0 6 0 0 #

Snoop

# snoop -c 3 // Crawl 3IP package Using Device / dev / pcn0 (promiscuous mode) 192.168.0.1 -> Solaris9 Telnet C port = 3013 Solaris9 -> 192.168.0.1 Telnet R port = 3013 USING Device / dev / pc 192.168 .0.1 -> Solaris9 Telnet C port = 3013 3 Packets Captured #

# snoop -v -c 2 // Caught two detailed IP packages. Using Device / dev / pcn0 (promiscuous mode) Ether: ----- Ether header ----- ether: ether: packet 1 arrived at 1: 43: 41.42 ether: packet size = 60 bytes ether: destination = 0: C: 29: 80: 4c: a, ether: source = 0: 3: f: fd: 6d: c, ether: ethertype = 0800 (ip) Ether: IP: ----- ip header ----- IP: IP: Version = 4 IP: Header Length = 20 BYTES IP: TYPE OF Service = 0x00 IP: XXX. .... = 0 (precedence) ip: ... 0 .... = Normal Delay IP:. ... 0 ... = Normal Throughput IP: .....0 .. = Normal Reliability IP: .... ..0. = NOT ECN CAPABLE TRANSPORT IP: .... ... 0 = NO ECN Congestion Experienced IP: Total length = 40 BYTES IP: Identification = 1627 IP: Flags = 0x4 IP: .1 .. .... = do not fragment ip: ..0. .... = Last Fragment IP: Fragment offset = 0 bytes IP: Time to live = 128 seconds / hops IP: Protocol = 6 (TCP) IP: Header checksum = 7320 IP: Source address = 192.168.0.1, 192.168.0.1 IP: Destination address = 192.168.0.3, solaris9 IP: No Options IP: TCP: ----- TCP Header ----- TCP: TCP: Source Port = 3013 TCP: DESTI Nation port = 23 (telnet) TCP: SEQUENCE NUMBER = 769864152 TCP: ACKNOWEDGEMENT NUMBER = 52297913 TCP: DATA Offset = 20 BYTES TCP: FLAGS = 0x10 TCP: 0 .... = No ECN CONGESTION WINDUCED TCP:. 0 .. .... = no ECN ECHO TCP: ..0. .... = No Urgent Pointer TCP: ... 1 .... = AcknowledgedGEment TCP: .... 0 ... = no Push TCP: .....0 .. = no reset tcp: .... ..0. = No syn tcp: .... ... 0 = no fin tcp: window = 17292 TCP: Checksum = 0x7b85 TCP : Urgent Pointer = 0 TCP: No Options TCP: Telnet: ----- Telnet: ----- Telnet: Telnet: "Telnet:

Ether: ----- Ether header ----- ether: ether: packet 2 arrived at 1: 43: 41.42 ether: packet size = 97 bytes ether: destination = 0: 3: f: fd: 6d: c, Ether: Source = 0: C: 29: 80: 4C: a, ether: ethertype = 0800 (ip) Ether: IP: ----- ip header ----- IP: IP: Version = 4 IP: Header Length = 20 BYTES IP: TYPE OF Service = 0x00 IP: XXX. .... = 0 ip: ... 0 .... = normal delay ip: .... 0 ... = Normal Throughput Ip: .....0 .. = Normal Reliability IP: .... ..0. = NOT ECN CAPABLE TRANSPORT IP: .... ... 0 = no ECN CongeeNCed IP: Total Length = 83 BYtes IP: Identification = 50744 IP: flags = 0x4 IP: .1 .. .... = do not fragment ip: ..0. .... = last fragment ip: fragment offset = 0 BYTES IP: TIME TO LIVE = 60 seconds / hops ip: protocol = 6 (TCP) IP: header checksum = f717 ip: source address = 192.168.0.3, Solaris9 IP: Destination Address = 192.168.0.1, 192.168.0.1 Ip: No Options IP: TCP: - --- TCP Header ----- TCP: TCP: Source Port = 23 TCP: Destination Port = 3013 TCP: SEQUENCE NUMBER = 52 297913 TCP: ACKNOWEDGEMENT NUMBER = 769864152 TCP: DATA OFFSET = 20 BYTES TCP: FLAGS = 0x18 TCP: 0 .... = No ECN CongeStion window reduuced tcp: .0 .. .... = no ECN ECHO TCP : ..0. .... = no urgent Pointer TCP: ... 1 .... = Acknowledgement TCP: .... 1 ... = push tcp: .....0 .. = no reset TCP: ......0. = No syn tcp: .... ... 0 = no fin tcp: window = 64240 TCP: Checksum = 0xd1f6 TCP: Urgent Pointer = 0 TCP: No Options TCP: Telnet: ----- Telnet: ----- Telnet: Telnet: "Using Device / dev / pcn0 (promiscuous mode) / r / n" Telnet: 2 Packets Captured #

# Snoop Host1 Host2 Host1 -> Host2 ICMP Echo Request Host2 -> Host1 ICMP Echo Reply Use the SNOOP utility to determine what kind of letter actually transmitted, judge the network smooth # snoop -a dhcp

Snoop Using Snoop is a tool comes into the Solaris system. It is a program for displaying network communication, which captures the IP package and displayed or saved to the specified file. (Limited superuser uses snoop) Snoop can capture The package is summarized in a row or in a detailed description (there is a different parameter-V -V to be modified). In summary mode (-V), only the highest level of relevant protocols, such as an NFS The package will only display NFS information. The low-level RPC, UDP, IP, and Ethernet frame information will not be displayed, but when the corresponding parameters (-V) are added, this information can be displayed. Parameter Description: [-a ] # Listen to packets on audio [-d device] # settable to le?, Ie?, Bf ?, tr? [-S snake] # truncate packets [-c count] # qitAfter count packets [-p] # Turn OFF promiscuous mode [-d] # report dropped packets [-s] # Report packet size [-i file] # read previously captured packets [-o file] # Capture Packets in file [-n file] # loading addr-to- Name Table from file [-n] # create addr-to-name table [-tr | a | d] # time: relative, absolute or delta [-v] # verbose packet display [-v] # show all summary lines -p first [, last] # select packet (s) to display [-x offset [, length] # hex dump from offset for length [-c] # Print Packet Filter Code Because Snoop is very flexible, I hope It is common to learn from the following examples. Displayed. # Snoop 2. Monitor all the packets with host A as the source and destination and display it. (A is the host name, the same below) - 2 - # Snoop A 3. Monitor all the packs between A and B And save it to file file. # Snoop -o file ab 4. Display file file specified in the package (99-108) # Snoop - I file -p 99,108 99 0.0027 Boutique -> Sunroof NFS C getattr fH = 8E6C 100 0.0046 sunroof -> boutique NFS R GETATTR OK 101 0.0080 boutique -> sunroof NFS C RENAME FH = 8E6C MTra00192 to .nfs08 102 0.0102 marmot -> viper NFS C LOOKUP FH = 561E screen.r.13.i386 103 0.0072 viper -> marmot NFS R LOOKUP No such file or directory 104 0.0085 bugbomb -> sunroof RLOGIN C PORT = 1023 h 105 0.0005 kandinsky -> sparky RSTAT C Get Statistics 106 0.0004 beeblebrox -> sunroof NFS C GETATTR FH = 0307 107 0.0021 sparky ->

Kandinsky Rstat R 108 0.0073 Office -> Jeremiah NFS C Read FH = 2584 AT 40960 for 8192 5. Detailed View File File Episode 101: # Snoop - I File - V -P101 Ether: ----- Ether Header - ---- Ether: Ether: Packet 101 Arrived AT 16: 09: 53.59 Ether: packet size = 210 bytes ether: destination = 8: 0: 20: 1: 3D: 94, Sun ether: Source = 8: 0: 69 : 1: 5F: E, Silicon Graphics Ether: ethertype = 0800 (ip) Ether: IP: ----- ip header ----- ip: IP: Version = 4, header length = 20 BYTES IP: TYPE OF Service = 00 ip: ..0. .... = routine ip: ... 0 .... = Normal delay IP: .... 0 ... = Normal Throughput ip: .... .0. = Normal reliability ip: Total length = 196 bytes IP: Identification 19846 IP: Flags = 0x ip: .0 .. .... = may fragment ip: ..0. .... = More Fragments? - 3 - 6. Check the NFS package between host a and host B (AND and OR in the command) # snoop - I file rpc nfs and a and b 1 0.0000 a-> b NFS c getattr fH = 8E6C 2 0.0046 B -> A NFS R Getattr OK 3 0.0080 A -> B NFS C Rename FH = 8E6C MTRA00192 To .nfs08 7. Save these eligible packages into another file file2: # snoop - I file -o file2 RPC NFS AB 8. Listening to the host a and host B All TCP 80 ports or UDP80 port package # snoop a and b and (tcp or udp) and port 80 9. Monitor all broadcast packs # snoop Broadcast Using Device / dev / hme Promiscuous mode) 10.10.10.50 -> Broadcast udp d = 177 s = 2541 len = 35 10.10.50 -> Broadcast udp d = 177 s = 2541 len = 35 10.10.10-> Broadcast udp d = 177 s = 2541 LEN = 35 10. Monitor all multicast packages and display details. #Snoop -v Multicast ether: ----- Ether header ----- ether: ether: packet 1 arrived at 12: 33: 2.16 Ether: packet Size = 69 BYTES Ether: Destination = ff: ff: ff: ff: ff: ff (Broadcast) Ether: Source = 0: 4: 76: 46: 8F: 50, Ether: ethertype =

0800 (IP) Ether: IP: ----- ip header ----- IP: IP: Version = 4 IP: Header length = 20 BYTES IP: TYPE OF Service = 0x00 IP: XXX. .... = 4 (precedence) ip: ... 0 .... = Normal DELAY - 4 - IP: .... 0 ... = Normal Throughput ip: .....0 .. = Normal Reliability IP: Total Length = 55 bytes IP: Identification = 14658 IP: flags = 0x0 ip: .0 .. .... = may fragment ip: ..0. .... = Last Fragment IP: fragment offset = 0 BYTES IP: Time To live = 128 seconds / hops IP: Protocol = 17 (UDP) IP: Header checksum = ed38 IP: Source address = 10.10.10.50, 10.10.10.50 IP: Destination address = 255.255.255.255, BROADCAST IP: No options IP: UDP: ---- UDP header ----- UDP: udp: source port = 2541 udp: destination port = 177 udp: length = 35 udp: checksum = 8e35 udp: ether: ----- Ether header --- - Ether: Ether: Packet 2 Arrived AT 12: 33: 12.16 Ether: packet size = 69 bytes Ether: destination = ff: ff: ff: ff: ff: ff, (Broadcast) Ether: Source = 0: 4: 76 : 46: 8F: 50, Ether: ethertype = 0800 (ip) Ether: IP: ----- ip header ---- - IP: IP: Version = 4 IP: header length = 20 bytes IP: type of service = 0x00 IP: XXX. .... = 0 (PRECEDENCE) IP: ... 0 ... 0 .... = Normal delay IP: .... 0 ... = Normal Throughput ip: .....0 .. = Normal Reliability IP: Total length = 55 BYTES IP: Identification = 14985 IP: Flags = 0x0 ip: .0 .. ... = May fragment ip: ..0. .... = Last Fragment = 0 BYTES IP: Time to live = 128 seconds / hops ip: protocol = 17 (udp) ip: header checksum = EBF1 IP: Source Address = 10.10.10.50, 10.10.10.50 - 5 - IP: Destination Address =

255.255.255.255, Broadcast IP: No Options IP: UDP: ----- UDP header ----- UDP: udp: source port = 2541 udp: destination port = 177 udp: length = 35 udp: checksum = 8e35 udp : 11. Monitor all NTP protocol package # snoop | GREP - I NTP Using Device / dev / hme (promiscuous mode) TS1 -> 224.0.1.1 NTP Broadcast (TUE Jul 23 12:48:50 2002) TS1 -> 224.0.1.1 NTP Broadcast (Ts1 -> 224.0.1.1 ntp broadcast (ts1) TS1 -> 224.0.1.1 NTP Broadcast (TUE Jul 23 12:52:02 2002) TS1 -> 224.0.1.1 NTP Broadcast (TUE Jul 23 12:53:06 2002) TS1 -> 224.0.1.1 NTP Broadcast (Tue Jul 23 12:54:10 2002) Here we can also see NTP Server every other minute That is to broadcast to the multicast address. Date # date 2003 on Sunday Sunday 10:04 16 seconds CST (CST is Chinese standard Time Abbreviation) # DATE 10121003 Setting time is October 12th 10:03

Device management

Floppy disk #volcheck fdformat [-Ddeefhllmmuqvx] [-b label] [-b filename] [-t dos- type] [devname] // formatted

Prtconf # prtconf // Configuration Information System Configuration: Sun Microsystems I86PC Memory Size: 128 Megabytes // Memory System Peripherals (Software Nodes):

i86pc boot (driver not attached) memory (driver not attached) aliases (driver not attached) chosen (driver not attached) i86pc-memory (driver not attached) i86pc-mmu (driver not attached) openprom (driver not attached) options, instance # 0 packages (driver not attached) delayed-writes (driver not attached) itu-props (driver not attached) isa, instance # 0 motherboard (driver not attached) asy, instance # 0 asy, instance # 1 lp (driver not attached) fdc, instance # 0 fd, instance # 0 fd, instance # 1 (driver not attached) i8042, instance # 0 keyboard, instance # 0 mouse, instance # 0 PNP0C02 (driver not attached) PNP0C02 (driver not attached) PNP0C02 (driver not attached) bios (driver not attached) bios (driver not attached) bios (driver not attached) pci, instance # 0 pci15ad, 1976 (driver not attached) pci8086,7191 (driver not attached) pci15ad, 1976 (driver not Attached) PCI-Ide, Instance # 0 IDE, Instance # 0 cmdk, instance # 0 IDE, Instance # 1 SD, Instance # 0 PCI15AD, 1976, Instance # 0 PCI15AD, 19 76 (driver not attached) display, instance # 0 pci1022,2000, instance # 0 pci1274,1371 (driver not attached) used-resources (driver not attached) objmgr, instance # 0 cpus (driver not attached) cpu, instance # 0 (Driver not attach) Pseudo, Instance # 0 # # prtconf | grep memory // View Memory Memory Size: 128 MegabytesAn # arch -k // Understanding Architecture I86PC Uname # uname SUNOS # uname -a Sunos Wing 5.9 generic_112234-03 i86pc i386 i86pc

Eject #Eject Floppy

EEPROM #EEPROM SelfTest - # megs = 64 // Modify the number of memory to self-test

Sysdef #Sysdef // More detailed system

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

New Post(0)