分享
 
 
 

Solaris 管理员常用命令

王朝other·作者佚名  2006-11-24
窄屏简体版  字體: |||超大  

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 */

[1] [2] 下一页

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有