免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4649 | 回复: 2
打印 上一主题 下一主题

solaris 高级命令 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2001-12-06 02:17 |只看该作者 |倒序浏览
Arp, ethernet trouble shooting  
  arp -a .
/* Shows the ethernet address arp table */  
  arp -d myhost
/* Delete a stale ethernet entry for host myhost */  
[ Back to Top ]
Disk Commands  
  du -k .
/* Reports disk space used in Kilobytes */  
  du -sk .
/* Reports only total disk space used in Kilobytes */  
  du -ad /var | sort -nr
/* Tells you how big the /var files are in reverse order */  
  fdformat -d -U
/* Format diskette */  
  /bin/mount -F hsfs -o ro /dev/sr0 /cdrom
/* Mount an ISO 8660 CDROM */  
  prtvtoc /dev/rdsk/c0t0d0s2
/* Disk geometry and partitioning info */  
[ Back to Top ]
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 */  
[ Back to Top ]
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 */  
  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 */  
  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 */  
  tar cvf filename.tar
/* Create a tape (tar) archive */  
  tar xvf filename.tar
/* Extract a tape (tar) archive */  
  /sbin/uadmin x x
/* Syncs File Systems and Reboots systems fast */  
[ Back to Top ]
File Transfer  
  put \"| tar cf - .\" filename.tar
/* Undocumented Feature of FTP */  
  find . -depth | cpio -pdmv /path/tobe/copied/to
/* Fast alternative to cp -pr */  
[ Back to Top ]
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 */  
[ Back to Top ]
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 */  
[ Back to Top ]
Memory  
  prtconf | grep \"Memory size\"
/* Display Memory Size */  
[ Back to Top ]
Network Information  
  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 -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 */  
[ Back to Top ]
Network/Tuning  
  ndd -set /dev/tcp tcp_xmit_hiwat 65535
/* Increase TCP-transmitbuffers */  
  ndd -set /dev/tcp tcp_recv_hiwat 65535
/* Increase TCP-receivebuffers */  
[ Back to Top ]
Processes  
  fuser -uc /var
/* Processes that are running from /var */  
  pfiles <pid>
/* Shows processes\' current open files */  
  prstat -a
/* An alternative for top command */  
  /usr/ucb/ps -aux | more
/* Displays CPU % usage for each process in ascending order */  
  ps -ef | more
/* Show all processes 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 */  
[ Back to Top ]
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 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 */  
[ Back to Top ]
Searching Items  
  find . -type f -print | xargs grep -i [PATTERN]
/* Recursive grep on files */  
  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 */  
[ Back to Top ]
Security  
  find / -type f -perm -2000 -print
/* Find all SGID files */  
  find / -type f -perm -4000 -print
/* find all SUID files */  
[ Back to Top ]
Set Terminal Options  
  stty erase ^H
/* Sets the Backspace Key to erase */  
  stty erase ^?
/* Sets the Delete Key to erase */  
  tput rmacs
/* Reset to standard char set */  
[ Back to Top ]
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 */  
[ Back to Top ]
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 */  
[ Back to Top ]
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 */  
[ Back to Top ]
System Configuration  
  /usr/sbin/eeprom auto-boot? false
/* Changes eeprom autoboot? setting without going to Ok prompt */  
  /usr/sbin/eeprom diagswitch? true
/* Set the system to perform diagnostics on the next reboot. */  
  /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 */  
[ Back to Top ]
System Information and Monitoring  
  /usr/sbin/eeprom
/* Show eeprom parameters */  
  /usr/sbin/prtconf -vp
/* Show system configuration details */  
  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 */  
  uname -a
/* Displays system information */  
  


   


论坛徽章:
0
2 [报告]
发表于 2001-12-06 11:09 |只看该作者

A few more solaris 高级命令 :

1. truss  see the following link for detail
http://sunsolve.sun.com/pub-cgi/show.pl?target=content/content10

2. ldd which lists dynamic  dependencies  of  executable  files

3. crash

4. adb 3&4 used to do core dump analysis.

论坛徽章:
0
3 [报告]
发表于 2009-08-18 21:16 |只看该作者
谢谢楼主,正需要!
雪中送炭呀
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP