SA Blog --系统管理员的博客生涯

书写自己的系统管理博客生涯
posts(330) comments(254) trackbacks(0)
  • IT博客
  • 联系
  • RSS 2.0 Feed 聚合
  • 管理

常用链接

  • 我的随笔
  • 我的评论
  • 我参与的随笔

留言簿

  • 给我留言
  • 查看公开留言
  • 查看私人留言

随笔分类(395)

  • *UNIX系统(148)
  • Cloud(3)
  • Moive
  • Music(1)
  • OpenStack(7)
  • openstack
  • Wiki(1)
  • Windows系统(32)
  • 其他(33)
  • 娱乐
  • 存储相关(22)
  • 存储网络(10)
  • 常用工具下载(25)
  • 数据库应用技术(53)
  • 网络技术(41)
  • 英语
  • 虚拟化(19)

随笔档案(330)

  • 2020年9月 (1)
  • 2020年8月 (1)
  • 2020年7月 (8)
  • 2020年4月 (1)
  • 2020年2月 (1)
  • 2020年1月 (1)
  • 2019年9月 (2)
  • 2019年4月 (1)
  • 2016年1月 (1)
  • 2015年12月 (1)
  • 2015年7月 (4)
  • 2015年5月 (2)
  • 2014年3月 (2)
  • 2014年1月 (1)
  • 2013年12月 (1)
  • 2013年3月 (5)
  • 2013年2月 (4)
  • 2012年12月 (1)
  • 2012年11月 (2)
  • 2012年9月 (2)
  • 2012年8月 (1)
  • 2012年6月 (1)
  • 2012年5月 (1)
  • 2012年1月 (1)
  • 2011年12月 (2)
  • 2011年10月 (1)
  • 2011年9月 (3)
  • 2011年8月 (1)
  • 2011年7月 (5)
  • 2011年6月 (3)
  • 2011年5月 (5)
  • 2011年4月 (2)
  • 2011年3月 (2)
  • 2011年2月 (1)
  • 2011年1月 (5)
  • 2010年12月 (1)
  • 2010年11月 (4)
  • 2010年9月 (13)
  • 2010年8月 (4)
  • 2010年7月 (5)
  • 2010年6月 (5)
  • 2010年5月 (13)
  • 2010年4月 (10)
  • 2010年3月 (5)
  • 2010年2月 (1)
  • 2010年1月 (9)
  • 2009年12月 (5)
  • 2009年11月 (5)
  • 2009年10月 (1)
  • 2009年9月 (3)
  • 2009年8月 (2)
  • 2009年7月 (6)
  • 2009年6月 (3)
  • 2009年5月 (2)
  • 2009年4月 (1)
  • 2009年3月 (2)
  • 2009年2月 (3)
  • 2008年12月 (3)
  • 2008年11月 (1)
  • 2008年10月 (9)
  • 2008年9月 (5)
  • 2008年8月 (3)
  • 2008年7月 (1)
  • 2008年6月 (1)
  • 2008年5月 (2)
  • 2008年4月 (1)
  • 2008年3月 (1)
  • 2008年2月 (3)
  • 2008年1月 (1)
  • 2007年12月 (5)
  • 2007年11月 (1)
  • 2007年10月 (6)
  • 2007年9月 (4)
  • 2007年8月 (4)
  • 2007年7月 (34)
  • 2007年6月 (1)
  • 2007年4月 (2)
  • 2007年3月 (1)
  • 2007年2月 (1)
  • 2006年11月 (1)
  • 2006年9月 (4)
  • 2006年8月 (4)
  • 2006年7月 (1)
  • 2006年6月 (10)
  • 2006年5月 (3)
  • 2006年4月 (14)
  • 2006年2月 (6)
  • 2006年1月 (6)
  • 2005年12月 (12)

收藏夹(5)

  • Other(5)

IT技术

  • MSDN 库(中文)
  • 欢迎使用 MSDN 库(中文),MSDN 库为使用 Microsoft® 工具、产品、技术和服务的开发人员提供必不可少的信息资源。MSDN 库包含操作方法和参考文档、示例代码、技术文章和其他内容。请浏览目录或使用搜索功能来查找所需内容。

健康

  • 体检咨询
  • 北京体检 体检咨询
  • 足医生
  • 足医生

友情链接

  • TestLink中文论坛
  • Testlink 中文论坛
  • 备案专题
  • 备案专题
  • 微软大中华区安全博客
  • 微软大中华区安全博客

存储技术

  • doit存储
  • doit 存储,存储热门论坛
  • ITPUB
  • Oracle DBA 热门中文社区
  • TechTarget IT专家网
  • 蓝德科技

网络技术

  • ChinaUnix 中文社区
  • ChinaUnix 热门中文社区

搜索

  •  

最新评论

  • 1. re: 吐槽一下阿里系软件,就是天天的升级???
  • 评论内容较长,点击标题查看
  • --David
  • 2. re: Symantec Backup exec system recovery 2010(BESR 2010)故障汇总
  • 评论内容较长,点击标题查看
  • --112
  • 3. re: OpenStack安装部署管理中常见问题解决方法(OpenStack-Lite-FAQ)
  • /home/stack/devstack/tools/worlddump.py -d /home/stack/logs
    求救这是什么问题啊。
  • --陈晓龙
  • 4. re: nokia 手机密码忘记后破解
  • nokia 2630,密码不见,恳请帮忙,谢谢
    串号:355219037959407
    lipolipo@gmail.com
  • --沈同学
  • 5. re: chroot 工具 jailkit 限制用户 活动范围 和 权限 _ 笔记
  • 是一个很好的工具嘛。感谢分享。
  • --少林功夫好

阅读排行榜

评论排行榜

View Post

Solaris管理员常用命令简明手册

              摘要:Solaris管理员常用命令简明手册(好你就顶拉)

转贴自Sun BigAdmin. 
没有翻译,因为本身已经很简单了,你觉得不错就顶。呵呵~
有人再加上自己觉得好用的命令技巧就更好了~

[code:1:f021e57ea8]
SysAdmin Commands

Debugging 

  truss executable 
/* Trace doing of given command ( useful debugging ) */  

  truss -f -p <pid of a shell> 
/* Using multiple windows, this can be used to trace setuid/setgid programs */  

Arp, ethernet trouble shooting  

  arp -a . 
/* Shows the ethernet address arp table */  

  arp -d myhost 
/* Delete a stale ethernet entry for host myhost */  

Disk Commands  

  du -k . 
/* Reports disk space used in Kilobytes */  

  du -sk . 
/* Reports only total disk space used in Kilobytes */  

  du -sk *|sort -k1,1n 
/* Reports total disk space used in Kilobytes in present directory */ 

  du -ad /var | sort -nr 
/* Tells you how big the /var files are in reverse order */  

  fdformat -d -U 
/* Format diskette */  

  /usr/bin/iostat -E 
/* Command to display drives statistics */  

  /bin/mount -F hsfs -o ro /dev/sr0 /cdrom 
/* Mount an ISO 9660 CDROM */  

  newfs -Nv /dev/rdsk/c0t0d0s1 
/* To view the superfblocks available */  

  prtvtoc /dev/rdsk/c0t0d0s2 
/* Disk geometry and partitioning info */  

  quot -af 
/* How much space is used by users in kilobytes */  
 
Driver Parameters  

  ndd /dev/ip \? 
/* Shows IP variables in the kernel */  

  ndd /dev/ip ip_forwarding 
/* Tells you if forwarding is on (=1) */  

  ndd -set /dev/ip ip_forwarding 1 
/* Enables IP forwarding between interfaces */  

File Manipulation  

  dos2unix | -ascii <filename> 
/* Converts DOS file formats to Unix */  

  split 
/* Split files into pieces */  

  [vi] : %s/existing/new/g 
/* Search and Replace text in vi */  

  [vi] :set nu 
/* Set line numbers in vi */  

  [vi] :set ts=[num] 
/* Set tab stops in vi */  
 
File System  

  cat /dev/null > filename 
/* Zero's out the file without breaking pipe */  

  dd if=/dev/rdsk/... of=/dev/rdsk/... bs=4096 
/* Make a mirror image of your boot disk */  

  df -k | grep dg| awk '{print $6}' |xargs -n 1 umount 
/* Unmount all file systems in disk group dg */  

  fsck -F ufs /dev/rdsk/c0t0d0s0 
/* Check a UFS filesystem on c0t0d0s0 */  

  fsck -F ufs -y /dev/rdsk/c0t0d0s0 
/* Check answering yes to all questions */  

  fsck -F ufs -o b=97472 /dev/rdsk/c0t0d0s0 
/* Check using an alternate super block */  

  gzip -dc file1.tar.gz | tar xf - 
/* Unpack .tar.gz files in place */  

  gzip -d -c tarball.tgz | (cd /[dir];tar xf - ) & 
/* Unpacking tarballs to diff location */  

  ln [-fhns] <source file> <destination file> 
/* Creating hard links and soft links */  

  ls -la | awk '{ print $5,"    ",$9 }' | sort -rn 
/* File sizes of current directory */  

  mount -f pcfs /dev/dsk/c0d0p1 /export/dos 
/* Mount DOS fdisk partition from Solaris */  

  mount -F ufs -o rw,remount / 
/* Used to remount root to make it writeable */  

  mount -o remount,logging /spare 
/* Re-mount the ro file system rw and turn on ufs logging */  

  pax -rw . /newdir 
/* Efficient alternative for copying directories */  

  prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t1d0s2 
/* Cloning Partitiontables */  

  tar cvf filename.tar 
/* Create a tape (tar) archive */  

  tar xvf filename.tar 
/* Extract a tape (tar) archive */  

  tar cf - . | (cd /newdir ; tar xf -) 
/* Recursively copy files and their permissions */  

  /sbin/uadmin x x 
/* Syncs File Systems and Reboots systems fast */  

  zcat [cpio file] | cpio -itmv 
/* Show the contents of a compressed cpio */  

  zcat <patch_file.tar.Z | tar xvf - 
/* Extract the patch_file that is a compressed tar file */  
 
File Transfer  

  get filename.suffix |"tar xf -" 
/* Undocumented Feature of FTP */  

  put "| tar cf - ." filename.tar 
/* Undocumented Feature of FTP */  

  find . -depth | cpio -pdmv /path/tobe/copied/to 
/* Fast alternative to cp -pr */  

  sendport 
/* Transferring large numbers of files within the same ftp control session */  

General  

  /usr/bin/catman -w 
/* Create windex databases for man page directories */  

  FQ_FILENAME=<fully_qualified_file_name>; echo ${FQ_FILENAME%/*} 
/* Extract directory from fully-qualified file name. */  

  mailx -H -u <username> 
/* List out mail headers for specified user */  

  set filec 
/* Set file-completion for csh */  

  uuencode [filename] [filename] | mailx -s "Subject" [user to mail] 
/* Send files as attachments */  

Hardware  

  cfgadm 
/* Verify reconfigurable hardware resources */  

  m64config -prconf 
/* Print M64 hardware configuration */  

  m64config -depth 8|24 
/* Sets the screen depth of your M64 graphics accelerator */  

  m64config -res 'video_mode' 
/* Change the resolution of your M64 graphics accelerator */  

Kernel  

  /usr/sbin/modinfo 
/* Display kernel module information */  

  /usr/sbin/modload <module> 
/* Load a kernel module */  

  /usr/sbin/modunload -i <module id> 
/* Unload a kernel module */  

  nm -x /dev/ksyms | grep OBJ | more 
/* Tuneable kernel parameters */  

  /usr/sbin/sysdef 
/* Show system kernal tunable details */  

Memory  

  prtconf | grep Mem 
/* Display Memory Size */  

Network Information  

  ndd /dev/arp arp_cache_report 
/* Prints ARP table in cache with IP and MAC address */  

  netstat -a | grep EST | wc -l 
/* Displays number active established connections to the localhost */  

  netstat -k hme0 
/* Undocumented netstat command */  

  netstat -i 
/* Show the TCP/IP network interfaces */  

  netstat -np 
/* Similar to arp -a without name resolution */  

  netstat -r 
/* Show network route table */  

  netstat -rn 
/* Displays routing information but bypasses hostname lookup. */  

  netstat -a | more 
/* Show the state of all sockets */  

  traceroute <ipaddress> 
/* Follow the route to the ipaddress */  
 
Network/Tuning  

  ifconfig eth0 mtu 1500 
/* Change MTU of interface */  

  ifconfig eth0 10.1.1.1 netmask 255.255.255.255 
/* Add an Interface */  

  /sbin/ifconfig hme0:1 inet 10.210.xx.xxx netmask 255.255.0.0 broadcast 10.210.xxx.xxx 
/* Virtual Interfaces */  

  /sbin/ifconfig hme0:1 up 
/* Bring virtual interface up */  

  /usr/sbin/ndd -set /dev/hme adv_100fdx_cap 1 
/* Nailling to 100Mbps */  

  ndd -set /dev/ip ip_addrs_per_if 1-8192 
/* To set more than 256 virtual ip addresses. */  

  ndd -set /dev/tcp tcp_xmit_hiwat 65535 
/* Increase TCP-transmitbuffers */  

  ndd -set /dev/tcp tcp_recv_hiwat 65535 
/* Increase TCP-receivebuffers */  

Processes  

  fuser -uc /var 
/* Processes that are running from /var */  

  kill -HUP `ps -ef | grep [p]roccess | awk '{print $2}'` 
/* HUP any related process in one step */  

  lsof -i TCP:25 
/* Mapping port with process */  

  pfiles <pid> 
/* Shows processes' current open files */  

  pkill -n <name> 
/* Kill a process by name */  

  kill `ps -ef | grep program_name | grep -v grep | cut -f8 -d ' '` 
/* pkill for solaris 2.6 */  

  prstat -a 
/* An alternative for top command */  

  /usr/ucb/ps -aux | more 
/* Displays CPU % usage for each process in ascending order */  

  /usr/ucb/ps -auxww | grep <process name> 
/* Gives the full listing of the process (long listing) */  

  ps -ef | grep -i <string> | awk '{ print $2 }' 
/* Creates list of running PID by */  

  ps -ef | grep -v "0:00" | more 
/* Gives you a list of any process with CPU time more than 0:00 */  

  ps -ef | more 
/* Show all processes running */  

  ps -eo pid,args 
/* List processes in simplified format */  

  ps -fu oracle|grep pmon 
/* See which instances of Oracle are running */  

  /usr/proc/bin/ptree <pid> 
/* Print the parent/child process 'tree' of a process */  

  /usr/proc/bin/pwdx <pid> 
/* Print the working directory of a process */  

  top -b 1 
/* Returns the process utilizing the most cpu and quits */  
 
Resource Management  

  /usr/bin/ldd [filename] 
/* List the dynamic dependencies of executable files */  

  /usr/proc/bin/pmap pid 
/* Report address space map a process occupies */  
 
Route Configuration  

  route add net 128.50.0.0 128.50.1.6 1 
/* Adds route to 128.50 network via 128.50.1.6 */  

  route change 128.50.0.0 128.50.1.5 
/* Changes the destination address for a route */  

  route delete net 128.50.0.0 128.50.1.6 
/* Deletes route to 128.50 network */  

  route get [hostname] 
/* Which interface will be used to contact hostname */  

  route monitor 
/* Monitors traffic to the routes */  

  route flush 
/* Removes all entries in the route table */  
 
Searching Items  

  egrep "patterna|patternb" <filename> 
/* Search for multiple patterns within the same file */  

  find . -exec egrep -li "str" {} \; 
/* Find a string in files starting cwd */  

  find / -fstype nfs -prune -o fstype autofs -prune -o -name filename -print 
/* Find without traversing NFS mounted file systems */  

  find . -mtime -1 -type f 
/* Find recently modified files */
  
  find / -mtime <# of days> 
/* Find files modified during the past # of days */ 
 
  find . ! -mtime -<days> | /usr/bin/xargs rm -rf 
/* Finds and removes files older than <days> specified */  

  find . -type f -exec grep "<sub-string>" {} \; -print 
/* Find files (and content) containing <sub-string> within directory tree */  

  find . -type f -exec grep -l "<sub-string>" {} \; 
/* Find filenames containing <sub-string> within directory tree */  

  find . -type f -print | xargs grep -i [PATTERN] 
/* Recursive grep on files */  

  find / -user <username> 
/* Find all files owned by <username> */  

  find / | grep [file mask] 
/* Fast way to search for files */  

  find <start_path> -name "<file_name>" -exec rm -rf {} \; 
/* Recursively finds files by name and automatically removes them */  

  find /proc/*/fd -links 0 -type f -size +2000 -ls 
/* Find large files held open by a process */  

  ls -lR | grep <sub_string> 
/* Fast alternative to find */  

Security  

  echo 'Please go away' > /etc/nologin 
/* Stops users logging in */  

  find / -perm -0777 -type d -ls 
/* Find all your writable directories */  

  find / -type f -perm -2000 -print 
/* Find all SGID files */  

  find / -type f -perm -4000 -print 
/* find all SUID files */  

Set Terminal Options  

  stty erase ^H 
/* Sets the Backspace Key to erase */  

  stty erase ^? 
/* Sets the Delete Key to erase */  

  stty sane 
/* Rreset terminal after viewing a binary file. */  

  tput rmacs 
/* Reset to standard char set */  
 
Snoop Your Network  

  snoop -d pcelx0 
/* Watch all network packets on device pcelx0 */  

  snoop -o /tmp/mylog pcelx0 
/* Saves packets from device pcelx0 to a file */  

  snoop -i /tmp/mylog host1 host2 
/* View packets from logfile between host1 & host2 */  

  snoop -i /tmp/mylog -v -p101 
/* Show all info on packet number 101 from a logfile */  

  snoop -i /tmp/mylog -o /tmp/newlog host1 
/* Write a new logfile with all host1 packets */  

  snoop -s 120 
/* Return the first 120 bytes in the packet header */  

  snoop -v arp 
/* Capture arp broadcasts on your network */  

Swap File  

  mkfile -v 10m /export/disk1/myswap 
/* Makes a 10 Megabyte swapfile in /export/disk */  

  mkfile -nv 10m /export/disk1/myswap 
/* Makes an empty 10 Megabyte swapfile */  
 
Swap Space  

  swap -s 
/* List the amount of swap space available, also see mkfile */  

  swap -a /export/disk1/swapfile 
/* Add a swapfile */  

  swap -d /dev/dsk/c0t0d0s4 
/* Deletes a swap device */  

  swap -l 
/* List the current swap devices */  
 
System Configuration  

  drvconfig ; disks 
/* Adding hot-plug disks to system */  

  /usr/sbin/eeprom auto-boot? false 
/* Changes eeprom autoboot? setting without going to Ok prompt */  

  /usr/sbin/eeprom diag-switch? true 
/* Set the system to perform diagnostics on the next reboot. */  

  /usr/sbin/eeprom local-mac-address?=true 
/* Multiple Port Network Card Setting */  

  /usr/sbin/grpck 
/* Check /etc/group file syntax */  

  /usr/sbin/pwck 
/* Check /etc/passwd file syntax */  

  /usr/sbin/sys-unconfig 
/* Clear host specific network configuration information */  

System Information and Monitoring  

  coreadm -e log 
/* Report global core */  

  /bin/echo "0t${stamp}>Y\n<Y=Y" | adb 
/* Convert UNIX timestamp to something human-readable */  

  /usr/sbin/eeprom 
/* Show eeprom parameters */  

  grep "\-root" /var/adm/sulog | grep -v \+ | tail -25 
/* List most recent attempts to switch to superuser account. */  

  isainfo -bv 
/* Quickly checkout if machine is in 32 or 64 bit mode */  

  last 
/* Tells who was or still is on the system */  

  logger -i 
/* Log the process ID */  

  psradm -f [processor id] 
/* Take processor offline */  

  /usr/sbin/prtconf -vp 
/* Show system configuration details */  

  /usr/platform/`/bin/uname -i`/sbin/prtdiag -v 
/* System Diagnostics */  

  prtconf -pv | grep banner-name |awk -F\' ' { print $2 } ' | head -1 
/* Show actual model name of machine */  

  psrinfo | wc -l 
/* Display number of processors */  

  sar -A <time in sec> 
/* Provides cumulative system report. */  

  sar -a <time in sec> 
/* Report use of file access system routines. */  

  sar -u 
/* Report CPU Utilization */  

  telnet <remote machine> 13 | grep ':' 
/* Get the time on remote Unix machine */  

  uname -a 
/* Displays system information */  

  vmstat 10 
/* Displays summary of what the system is doing every 10 seconds */  

  who -b 
/* Displays the date of the last system reboot. */  

  ypcat hosts | sort -n -t. +0 -1 +1 -2 +2 -3 +3 -4 
/* Take the input of "ypcat hosts" or "cat /etc/inet/hosts" and sort by IP. */  

posted on 2006-04-28 17:40 David 阅读(257) 评论(0)  编辑 收藏 引用 所属分类: *UNIX系统

只有注册用户登录后才能发表评论。
 
Powered by:
IT博客
Copyright © David