服务器 频道

soalris 命令以及sa239考点集锦

  【IT168 服务器学院】这是我做题后自己的小小总结,写一遍加深记忆,贴上来大家共享!!!
  
  (1),
  ls li 显示文件块号;
  ls R dir 递归显示dir目录下的内容,
  (2),
  # prtconf | grep v not
  
  
  (3),(必考)
  devfsadm c device_class
  
  devfsadm 参数汇总
  c 指定class
  i 检测指定设备名;
  v 检测硬件,更改/dev and /devices目录内容;
  C 检测删除硬件,更改目录内容;
  
  (4),
  newfs /dev/rdsk/c1t3d0s0
  
  在newfs创建文件系统时,会留出1%10%的空间给newfs给维护所用,这个参数就是minfree,可用命令fstyp查看minfree的值;在newfs创建文件系统时可以用 newfs m %free 来指定;
  (5),
  fstyp v /dev/rdsk/c0t0d0s0 | head 10 显示free的大小;
  如果不加v参数,则只显示挂接的文件类型:如只显ufs
  
  (6),
  如果想修改此参数,可用以下命令:
  tunefs m 1 /dev/rdsk/c1t3d0s0
  
  
  (7)
  可以用prtvtoc 命令把磁盘的VTOC保存到一个文件中:
  例如: prtvtoc /dev/rdsk/c1t0d0s2 > /vtoc/c1t0d0
  
  可以把prtvtoc命令的输出内容导入到另外一块硬盘中去:
  
  例如: fmthard s datafile /dev/rdsk/c #t #d #s2
  
  
  
  (8)
  
  
  
  df – Displays the number of free disk blocks
  (9)
  
  du – Summarizes disk use

  (10)
  
  quot – Summarizes file system ownership
  
  
  (11),
  
  使用mountall命令:
  
  mountall l 只mount本地的所有文件系统;
  
  
  Using the fstyp Command来查看文件类型:
  
  
  # fstyp /dev/rdsk/c0t0d0s7
  ufs
  
  
  (12)
  使用mount命令的option
  Some options used to mount local file systems include: ro, nosetuid,
  noatime, nolargefiles, and logging.
  
  
  
  (13)
  umount所有文件系统:
  #umountall
  umount所有本地的文件系统:
  #umountall l
  
  
  fuser command – Lists all of the processes that are accessing the file
  system and kills them if necessary
  
  
  (14),
  umountall状态为busy的系统:
  
  以下四种情况,文件系统都会显示:umount: file_system_name busy
  
  1 A program is accessing a file or directory in the file system
  2 A user is accessing a directory or file in the file system
  3 A program has a file open in that file system
  4 The file is being shared
  
  有两种方法解决:
  (1) 使用fuser命令来确认挂接点有那些进程在访问,然后杀掉
  (2) 用umount f 强制umount;
  
  (15),
  
  volume management两个重要文件:
  
  /etc/vold.conf volume management配置文件,配置一些条目,如插入,弹出设备时的动作,
  那些设备被volume management管理,那些设备是不安全弹出等.
  
  /etc/rmmount.conf rmmount命令的配置文件,rmmount是一个被volume management在光盘或
  软盘弹出时执行的命令;
  
  
  (16),
  
  
  volcheck检测diskette和其它可移动设备.
  
  (17),
  
  
  停止卷管理服务:
  # /etc/init.d/volmgt stop 或 # pkill 9 vold
  启动卷管理服务:
  # /etc/init.d/volmgt start
  
  
  
  (18),
  
  # pkginfo | more
  
  显示所有软件包的详细信息:
  # pkginfo l | more
  显示SUNWman软件包的详细信息:
  
  # pkginfo l SUNWman
  
  
  显示系统已安装软件包的数量:
  # pkginfo | wc l
  
  (19),
  显示光盘相关目录的软件包:
  pkginfo d /cdrom/cdrom0/s0/Solaris_9/Product |more
  
  提示:光盘CD1of2 中放了core and END USER software Groups
  cd2 of 2 中放了Developer, Entire Distribution, and Entire Distribution Plus OEM Support software groups.
  
  (20),
  安装软件包从光盘到系统中:
  # pkgadd d . SUNWns6m

  (21),
  查看软件安装状况:
  # pkgchk SUNWcarx
  
  加v 参数可查看软件包安装在那些目录下放置了文件:
  # pkgchk v SUNWcarx
  
  查看文件状态:
  #pkgchk p /etc/passwd
  查看passwd文件什么时候软件包创建,最一次修改时间以及原始文件大小,及现在大小;
  #pkgchk l p /etc/group
  查看此文件被那个软件包创建,以及一些相关信息;
  
  提示:必须使用绝对路径,否则不显示信息;
  
  (22), 删除软件包:
  
  # pkgrm SUNWapchr 删除软件包SUNWapchr
  
  (23),
  增加一个软件包spool 路径:
  默认情况下,spool路径放在/var/spool/pkg ,
  增加方法如下:
  # pkgadd d /cdrom/cdrom0/s0/Solaris_9/Product s spool SUNWensqr.u
  
  如果想删除spool路径:
  # pkgrm s spool SUNWensqr.u
  
  如果想增加一个spool中径到一个自己指定的目录/export/pkg下,则如下操作:
  
  # pkgadd d /cdrom/cdrom0/s0/Solaris_9/Product s /export/pkg SUNWensqr.u
  # pkgrm s /export/pkg SUNWensqr.u
  
  
  (24),
  
  安装:
  # patchadd 10505001
  
  # patchrm 10505001
  
  
  安装patch cluster:
  
  patch cluster由推荐补丁,安全补丁以及Y2K patch组成;安装时必须在/ /var /usr /opt有至少10M的空间,会把patch存在/var/sadm/pkg目录,也可nosave,将不能对个别patch进行恢复删除,
  
  
  # cd patch_cluster_directory
  # ./install_cluster
  
  
  
  (25),To display revsion of OpenBoot PROM :
  #/usr/platform/''uname m''/sbin/prtdiag v
  
  
  (26), NVRAM ''s noneditable area :
  
  The Ethernet address, such as 8:0:20:5d:6f:9e
  The HostID value ,such as 805d6f83

  (27),stop + D
  stop + N
  Stop + A 三个命令的作用
  
  (28),停止在系统运行时stop+A的作用:
  /etc/default/kbd
  删除KEYBOARD ABORT=disable的注册符;
  
  
  (29),Boot PROM command: (必考)
  
  banner displays the poweron banner(also list Ethernet address,HostID,model name , boot PROM version,the amount of memory.)
  boot boots the system(s boot the system to singleusermode;
  a boot the system interactively;
  v boots the system displaying more detailed info;
  r Performs a reconfigration boot.)
  help Lists the main help categories
  words displays the FORTH words in the dictionary
  sifting text Displays the FORTH commands contianing text
  Printenv Dislplays all paramenter''s current and default values.
  setenv set the specified NVRAM parameter to some value.
  resetall Resets the entire system; similar to a power cycle.
  setdefaults Resets all paramter values to the factory defualts.
  probeide
  probescsi
  probefcalall
  probescsiall
  probeide
  probepcislot
  test Runs selftest on specified devices;
  .version Displays the version and the date of the boot PROM;
  .enetaddr Displays the Ethernet address;
  .idprom Displays the IP PROM contents.
  .speed Displays the speed oft processor and of the buses attached to the sytem;
  .registers Displays the contents of the registers;
  
  showdevs view the entire device tree;
  devalias To identify the current boot device alias for the system;
  nvalias Creat a new device alias name;
  nvunalias Remove a custom device alias name;
  
  
  
  (30),Identifying RUN level (必考)
  
  0 and S and 1 , this three level differ;
  difference between 2 and 3 level;
  
  0 ,PROM monitor
  S , singleuser mode with critical file systems;
  1 , singleuser mode with all available local file systems;
  2 , multiuser mode, All system daemons are running except NFS and other network resource;
  3 , multiuser mode , all system and has NFS ,/etc/inittab file default level;
  5 , shutdown and power off;
  6 , shutdown and reboots to the default run level.
  
  
  (31),reboot or shutdown system command
  
  init 5 change run level to 5 and poweroff
  init 6 reboot system to default run level;
  halt shutdwon system ,stop the solaris OE ,change run level to 0
  shutdown shutdown g 30 i 5 y ,have grace period;
  poweroff immediate shutdown
  reboot immediate shutwon and reinitialization system;
  
  (32),
  useing the solaris OE Print Manager
  /user/sadm/admin/bin/printmgr &
  
  
  (33), administering Printer services
  
  lpadmin
  lpstat
  lpshut
  
  
  (34), pinter command;
  
  accept permits print requests to the queued
  reject prevents print requests from queued
  enable activate the specified printers
  disable deactivates the specified printers
  lpmove moves the print requests
  
  (35), useing the CDE process manager
  /usr/dt/bin/sdtprocess &
  
  
  (36), prstat command and the option (必考)
  
  a displays separate reports
  c continuously prints new reports
  n nproc restricts the number of output lines
  p pidlist reports only on processes that have a PID
  s key sort output lines by key in descending
  S key sort output lines bye key in ascending
  t reports total usage summary for ech user
  u euidlist reports only processes that EUID
  U euidlist reports only processes that real UID
  
  
  (37), kill and pkill command
  1 SIGHUP hangup
  2 SIGINT interrupt
  9 SIGKILL kill
  15 SIGTERM terminate
  
  
  (38),scheduling an Automatic onetime execution
  
  at command
  m sends mail to the user
  r job removes a scheduled at job from the queue
  time specifies a time
  l reports all jobs
  date specifies an optional date
  
  (39), at.deny and at.allow file
  
  if at.allow file exists, only the users listed in this at.allow file.
  if at.allow file does not exists, all users except for users listed in at.deny;
  if neither file exists, only the root can use the at comman;
  
  
  (40), /var/spool/cron/crontabs
  
  10 3 * * 0 /usr/sbin/log/adm
  minute
  hour
  day
  month
  day of week
  command
  cron.allow and cron.deny similar to at.allow and at.deny
  
  
  (41), mt command
  
  mt f tapedevicename command count
  
  mt status displays status information about the tape drive;
  mt rewind rewind the tape
  mt offline rewinds the tape and ,takes the drive offline
  mt fsf count moves the tape forward count records
  
  
  (42), backing up an Unmounted File systems
  
  ufsdump option argument filesystem_name
  
  09 back up level
  v verify
  S size estimate.
  l autoload
  o offline
  u update
  n notify
  f device specify.
  N incrmental backup
  e.g. : ufsdump 0uf /dev/rmt/0 /export/home
  
  
  (43), restor a ufs file system
  
  ufsrestore option argument filsystem
  t lists the table of contents of the backup media
  r restors the entire file system
  x file1 file2 restores only the files
  i invoke interactive restore
  v verbos mode
  f device specifies the tape device name
  
  
  (44),fssnap command
  d delete the snapshot associated with the geiven file system;
  if the o unlink option was used when you built the snapshot,the
  backingstore file is deleted together with th snapshot.
  F FSType specifies the file systme type to be used
  i displays the state of the snapshot
  V echoes the complete command line but does note execute
  o enable you to use special_option
  
  
  备注:
  从做boson来看以上内容是学习中需要掌握的
  
  补充:
  第一章的常用目录是必考内容,以及patchadd command error code 也是必考的,38个error code是需要记住的.
  

0
相关文章