## ---- [커널비트정보] --------
< SUN >
# isainfo -kv
< HP >
# getconf KERNEL_BITS
< AIX >
# bootinfo -y
## ------[환경변수설정]--------------
export CLASSPATH=`pwd`/fasoo-jni-1.1.18.jar:.
export SHLIB_PATH=`pwd`/lib
setenv CLASSPATH 'pwd'/fasoo-jni-1.1.18.jar:.
setenv SHLIB_PATH `pwd`/lib
## --------------------------
Additional Resources
1. All Solaris Commands * 2005-08-09
2. Alphabetical Directory of Linux Commands * 2005-03-22
3. Comparision of Shell commands (PDF) * 2005-11-19
4. Cool Commands * 2006-05-15
5. coolcommands.com * 2005-10-13
6. DOS to UNIX command translation * 2006-02-09
7. Man Pages: System Administration Commands (Solaris 10) 2006-02-14
8. Man Pages: System Administration Commands (Solaris 9) 2006-02-14
9. Man Pages: User Commands (Solaris 10) 2006-02-14
10. Man Pages: User Commands (Solaris 9) 2006-02-14
11. Tips on good shell programming practices * 2006-03-10
12. Trapping Special Characters in the Korn Shell * 2005-10-13
13. Universal Command Guide for Operating Systems * 2005-01-19
Back to top
Debugging
14. cat -v -t -e [file]
/* Show non-printing characters */ 2006-06-20
15. dumpadm -d swap
/* Configure swap device as dump device */ 2005-02-16
16. ld -l <libname without 'lib'>
/* Check if you have a particular library */ 2005-03-30
17. truss -f -p <pid of a shell>
/* Using multiple windows, this can be used to trace setuid/setgid programs */ 2005-03-22
18. truss executable
/* Trace doing of given command ( useful debugging ) */ 2005-03-22
Back to top
Disk Commands
19. /bin/mount -F hsfs -o ro /dev/sr0 /cdrom
/* Mount an ISO 9660 CDROM */ 2005-03-22
20. /usr/bin/iostat -E
/* Command to display drives statistics */ 2005-03-22
21. du -ad /var | sort -nr
/* Report the the disk used in /var in reverse order */ 2005-03-22
22. du -k .
/* Report disk usage in Kilobytes */ 2005-03-22
23. du -sk * | sort -nr | head
/* Shows the top ten largest files/directories */ 2005-01-19
24. du -sk *|sort -k1,1n
/* Reports total disk space used in Kilobytes in present directory */ 2005-03-22
25. du -sk .
/* Report total disk usage in Kilobytes */ 2005-03-22
26. fdformat -d -U
/* Format diskette */ 2005-03-22
27. newfs -Nv /dev/rdsk/c0t0d0s1
/* To view the superfblocks available */ 2005-03-22
28. prtvtoc /dev/rdsk/c0t0d0s2
/* Disk geometry and partitioning info */ 2005-03-22
29. prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t1d0s2
/* Copy partition table from one disk to another */ 2005-12-16
30. quot -af
/* How much space is used by users in kilobytes */ 2005-03-22
31. volrmmount -i floppy
/* Mount a floppy or other media easily by its nickname. */ 2005-08-03
Back to top
Driver Parameters
32. ndd /dev/ip ip_forwarding
/* Show the ip_forwarding variable in the kernel */ 2005-03-22
33. ndd /dev/ip ip_forwarding 1
/* Set the ip_forwarding variable in the kernel */ 2005-03-22
34. ndd /dev/ip \?
/* Show all IP variables set in the kernel */ 2005-03-22
Back to top
File Manipulation
35. dos2unix | -ascii <filename>
/* Converts DOS file formats to Unix */ 2005-03-22
36. fold -w 180
/* To break lines to have maximum char */ 2005-07-26
37. split [-linecount] [file]
/* Split files into pieces */ 2005-03-22
38. [vi] : %s/existing/new/g
/* Search and Replace text in vi */ 2005-03-22
39. [vi] :set list
/* Show non-printing characters in vi */ 2006-04-10
40. [vi] :set nu
/* Set line numbers in vi */ 2005-03-22
41. [vi] :set ts=[num]
/* Set tab stops in vi */ 2005-03-22
Back to top
File System
42. /sbin/uadmin x x
/* Syncs File Systems and Reboots systems fast */ 2005-03-22
43. awk ' END {print NR}' file_name
/* Display the Number of lines in a file */ 2005-08-03
44. cat /dev/null > filename
/* Zero's out the file without breaking pipe */ 2005-03-22
45. dd if=/dev/rdsk/... of=/dev/rdsk/... bs=4096
/* Make a mirror image of your boot disk */ 2005-03-22
46. df -k | grep dg| awk '{print $6}' |xargs -n 1 umount
/* Unmount all file systems in disk group dg */ 2005-03-22
47. fsck -F ufs -o b=97472 /dev/rdsk/c0t0d0s0
/* Check and repair a UFS filesystem on c0t0d0s0, using an alternate superblock */ 2005-03-22
48. fsck -F ufs -y /dev/rdsk/c0t0d0s0
/* Check a UFS filesystem on c0t0d0s0, repair any problems without prompting. */ 2005-03-22
49. fsck -F ufs /dev/rdsk/c0t0d0s0
/* Check a UFS filesystem on c0t0d0s0 */ 2005-03-22
50. gzip -d -c tarball.tgz | (cd /[dir];tar xf - ) &
/* Unpacking tarballs to diff location */ 2005-03-22
51. gzip -dc file1.tar.gz | tar xf -
/* Unpack .tar.gz files in place */ 2005-03-22
52. ln [-fhns] <source file> <destination file>
/* Creating hard links and soft links */ 2005-03-22
53. ls -al | awk '$3 == "oracle" || $3 == "root" {print $9}'
/* List all file names by testing owner */ 2005-08-03
54. ls -l | sort +4n
/* List files by size */ 2005-08-09
55. ls -la | awk '{ print $5," ",$9 }' | sort -rn
/* File sizes of current directory */ 2005-03-22
56. ls -lR | awk '{total +=$5};END {print "Total size: " total/1024/1024 "MB" }'
/* Recursive directory size calculations in MB */ 2005-08-03
57. mkisofs -l -L -r -o [image-name].iso [directory]
/* Create an ISO image of a directory */ 2006-03-06
58. mount -F ufs -o rw,remount /
/* Used to remount root to make it writeable */ 2005-03-22
59. mount -o remount,logging /spare
/* Re-mount the ro file system rw and turn on ufs logging */ 2005-03-22
60. mount DOS fdisk partition from Solaris
/* mount -f pcfs /dev/dsk/c0d0p1 /export/dos */ 2005-03-22
61. mv [filename]{,.new_suffix}
/* Renaming file */ 2006-06-20
62. pax -rw . /newdir
/* Efficient alternative for copying directories */ 2005-03-22
63. prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t1d0s2
/* Cloning Partitiontables */ 2005-03-22
64. rpm -q --queryformat '%{INSTALLPREFIX}\n' [packagename]
/* [Linux] Locate binaries */ 2005-08-16
65. tar cf - . | (cd /newdir ; tar xf -)
/* Recursively copy files and their permissions */ 2005-03-22
66. tar cvf filename.tar
/* Create a tape (tar) archive */ 2005-03-22
67. tar xvf filename.tar
/* Extract a tape (tar) archive */ 2005-03-22
68. X=$(wc -l < filename); echo $X
/* Count number of lines in a file into a variable (ksh) */ 2005-02-06
69. zcat <patch_file.tar.Z | tar xvf -
/* Extract the patch_file that is a compressed tar file */ 2005-03-22
70. zcat [cpio file] | cpio -itmv
/* Show the contents of a compressed cpio */ 2005-08-17
Back to top
File Transfer
71. find . -depth | cpio -pdmv /path/tobe/copied/to
/* Fast alternative to cp -pr */ 2005-03-22
72. find . -follow | cpio -pdumL /path/tobe/copied/to
/* Copy with symbolic links to be followed */ 2006-02-16
73. get filename.suffix |"tar xf -"
/* Undocumented Feature of FTP */ 2005-03-22
74. Move any file(s) without actually touching them
/* ssh cd /some/directory \&\& tar cf - | ssh cd /some/direstory \&\& tar xvf - */ 2005-12-01
75. put "| tar cf - ." filename.tar
/* Undocumented Feature of FTP */ 2005-03-22
76. sendport
/* FTP command for transferring large numbers of files within the same control session */ 2005-03-22
Back to top
General
77. /bin/printf '%d\n' '0x<hex>'
/* Converts hexadecimal number to decimal. */ 2005-03-30
78. /usr/bin/catman -w
/* Create windex databases for man page directories */ 2005-03-22
79. FQ_FILENAME=<fully_qualified_file_name>; echo ${FQ_FILENAME%/*}
/* Extract directory from fully-qualified file name. */ 2005-03-22
80. mailx -H -u <username>
/* List out mail headers for specified user */ 2005-03-22
81. ps -ef | grep -i $@
/* Access common commands quicker */ 2006-02-16
82. set filec
/* Set file-completion for csh */ 2005-03-22
83. uuencode [filename] [filename] | mailx -s "Subject" [user to mail]
/* Send files as attachments */ 2005-03-22
84. xauth -f /home/${LOGNAME} extract - ${DISPLAY} | xauth merge -
/* Allow root to xdisplay after su */ 2006-09-12 - New/Updated
Back to top
Hardware
85. cfgadm
/* Verify reconfigurable hardware resources */ 2005-03-22
86. m64config -depth 8|24
/* Sets the screen depth of your M64 graphics accelerator */ 2005-03-22
87. m64config -prconf
/* Print M64 hardware configuration */ 2005-03-22
88. m64config -res 'video_mode'
/* Change the resolution of your M64 graphics accelerator */ 2005-03-22
89. prtpicl -v | grep sync-speed
/* Discover SCSI sync speed */ 2005-04-26
Back to top
Kernel
90. /usr/sbin/modinfo
/* Display kernel module information */ 2005-03-22
91. /usr/sbin/modload <module>
/* Load a kernel module */ 2005-03-22
92. /usr/sbin/modunload -i <module id>
/* Unload a kernel module */ 2005-03-22
93. /usr/sbin/sysdef
/* Show system kernal tunable details */ 2005-03-22
94. nm -x /dev/ksyms | grep OBJ | more
/* Tuneable kernel parameters */ 2005-03-22
Back to top
Memory
95. pagesize -a
/* Available page sizes for Solaris 9 */ 2005-06-08
96. prtconf | grep Mem
/* Display Memory Size of the local machine. */ 2005-03-22
Back to top
Network Information
97. arp -a
/* Ethernet address arp table */ 2005-03-22
98. arp -d myhost
/* Delete an ethernet address arp table entry */ 2005-03-22
99. lsof -iTCP@10.20.2.9
/* Display open files for internet address */ 2006-04-03
100. ndd /dev/arp arp_cache_report
/* Prints ARP table in cache with IP and MAC address */ 2005-03-22
101. netstat -a | grep EST | wc -l
/* Displays number active established connections to the localhost */ 2005-03-22
102. netstat -a | more
/* Show the state of all the sockets on a machine */ 2005-03-22
103. netstat -i
/* Show the state of the interfaces used for TCP/IP traffice */ 2005-03-22
104. netstat -k hme0
/* Undocumented netstat command */ 2005-03-22
105. netstat -np
/* Similar to arp -a without name resolution */ 2005-03-22
106. netstat -r
/* Show the state of the network routing table for TCP/IP traffic */ 2005-03-22
107. netstat -rn
/* Displays routing information but bypasses hostname lookup. */ 2005-03-22
108. snoop -S -ta [machine]
/* Snoop for network packets and get size and time stamp entries. */ 2005-11-04
109. traceroute <ipaddress>
/* Follow the route to the ipaddress */ 2005-03-22
Back to top
Network Tuning
110. /sbin/ifconfig hme0:1 inet 10.210.xx.xxx netmask 255.255.0.0 broadcast 10.210.xxx.xxx
/* Virtual Interfaces */ 2005-03-22
111. /sbin/ifconfig hme0:1 up
/* Bring virtual interface up */ 2005-03-22
112. /usr/sbin/ndd -set /dev/hme adv_100fdx_cap 1
/* Nailling to 100Mbps */ 2005-03-22
113. ifconfig eth0 10.1.1.1 netmask 255.255.255.255
/* Add an Interface */ 2005-03-22
114. ifconfig eth0 mtu 1500
/* Change MTU of interface */ 2005-03-22
115. ndd -set /dev/ip ip_addrs_per_if 1-8192
/* To set more than 256 virtual ip addresses. */ 2005-03-22
116. ndd -set /dev/tcp tcp_recv_hiwat 65535
/* Increase TCP-receivebuffers on Sol2.5.1 systems with 100BaseTx */ 2005-03-22
117. ndd -set /dev/tcp tcp_xmit_hiwat 65535
/* Increase TCP-transmitbuffers on Sol2.5.1 systems with 100BaseTx */ 2005-03-22
Back to top
Processes
118. /usr/proc/bin/ptree <pid>
/* Print the parent/child process 'tree' of a process */ 2005-03-22
119. /usr/proc/bin/pwdx <pid>
/* Print the working directory of a process */ 2005-03-22
120. /usr/ucb/ps -aux | more
/* Displays CPU % usage for each process in ascending order */ 2005-03-22
121. /usr/ucb/ps -auxww | grep <process name>
/* Gives the full listing of the process (long listing) */ 2005-03-22
122. fuser -uc /var
/* Processes that are running from /var */ 2005-03-22
123. ipcs
/* Report inter-process communication facilities status */ 2005-03-28
124. kill -HUP `ps -ef | grep [p]roccess | awk '{print $2}'`
/* HUP any related process in one step */ 2005-03-22
125. lsof -i TCP:25
/* Mapping port with process */ 2006-02-22
126. pfiles <pid>
/* Shows processes' current open files */ 2005-03-22
127. pkill -n <name>
/* Kill a process by name */ 2005-03-22
128. prstat -a
/* An alternative for top command */ 2005-03-22
129. ps -edf -o pcpu,pid,user,args
/* Nicely formatted 'ps' */ 2006-03-06
130. ps -ef | grep -i <string> | awk '{ print $2 }'
/* Creates list of running PID by <string> */ 2005-03-22
131. ps -ef | grep -i <string> | awk '{ print $2 }'
/* Creates list of running PID by */ 2005-03-22
132. ps -ef | grep <process name> | grep -v grep | cut -c 10-15 | xargs kill -9
/* Find and kill all instances of a given process */ 2005-12-01
133. ps -ef | more
/* Show all processes running */ 2005-03-22
134. ps -ef|grep -v "0:00"|more
/* Gives you a list of any process with CPU time more than 0:00 */ 2005-03-22
135. ps -eo pid,args
/* List processes in simplified format */ 2005-03-22
136. ps -fu oracle|grep pmon
/* See which instances of Oracle are running */ 2005-03-22
137. top -b 1
/* Returns the process utilizing the most cpu and quits */ 2005-03-22
Back to top
Resource Management
138. /usr/bin/ldd [filename]
/* List the dynamic dependencies of executable files */ 2005-03-22
139. /usr/proc/bin/pmap pid
/* Report address space map a process occupies */ 2005-03-22
Back to top
Route Configuration
140. route add net 128.50.0.0 128.50.1.6 1
/* Add a route to the routing table */ 2005-03-22
141. route change 128.50.0.0 128.50.1.5
/* Changes the destination address for a route */ 2005-03-22
142. route delete net 128.50.0.0 128.50.1.6
/* Delete a route from the routing table */ 2005-03-22
143. route flush
/* Flush the routing table, which will remove all entries */ 2005-03-22
144. route get [hostname]
/* Which interface will be used to contact hostname */ 2005-03-22
145. route monitor
/* Monitor routing table lookup misses and changes */ 2005-03-22
Back to top
Searching Items
146. egrep "patterna|patternb" <filename>
/* Search for multiple patterns within the same file */ 2005-03-22
147. find <start_path> -name "<file_name>" -exec rm -rf {} \;
/* Recursively finds files by name and automatically removes them */ 2005-03-22
148. find . -type f -print | xargs grep -i [PATTERN]
/* Recursive grep on files */ 2005-03-22
149. find . ! -mtime -<days> | /usr/bin/xargs rm -rf
/* Finds and removes files older than <days> specified */ 2005-03-22
150. find . -exec egrep -li "str" {} \;
/* Find a string in files starting cwd */ 2005-03-22
151. find . -mtime -1 -type f
/* Find recently modified files */ 2005-03-22
152. find . -type f -exec grep "<sub-string>" {} \; -print
/* Find files (and content) containing <sub-string> within directory tree */ 2005-03-22
153. find . -type f -exec grep -l "<sub-string>" {} \;
/* Find files (and content) containing <sub-string> within directory tree */ 2005-03-22
154. find ./ \! -type f -exec ls -l {} \;|grep -v '^[l|p|s|-]'|grep -v 'total' | wc -l
/* Find number of directories under the current directory */ 2005-02-06
155. find / -fstype nfs -prune -o fstype autofs -prune -o -name filename -print
/* find without traversing NFS mounted file systems */ 2005-03-22
156. find / -mtime <# of days>
/* Find files modified during the past # of days */ 2005-03-22
157. find / -perm -2 -a ! -type l
/* Find files writable by 'others' */ 2005-04-12
158. find / -type f |xargs ls -s | sort -rn |more
/* List files taking up the most system space */ 2005-07-26
159. find / -user <username>
/* Find all files owned by <username> */ 2005-03-22
160. find / | grep [file mask]
/* Fast way to search for files */ 2005-03-22
161. find /proc/*/fd -links 0 -type f -size +2000 -ls
/* Find large files moved or deleted and held open by a process */ 2005-03-22
162. grep <full_path_to_filename> /var/sadm/install/contents| awk '{ print $1 ' ' $10 }'
/* Find which package contains a particular file */ 2005-02-06
163. ls -lR | grep <sub_string>
/* Fast alternative to find. */ 2005-03-22
Back to top
Security
164. crypt <abc.cr> abc && rm abc.cr
/* Decrypting a file that has been encrypted */ 2005-12-01
165. crypt <abc> abc.cr && rm abc
/* File encryption with crypt */ 2005-12-01
166. echo 'Please go away' > /etc/nologin
/* Stops users logging in */ 2005-03-22
167. find / -perm -0777 -type d -ls
/* Find all your writable directories */ 2005-03-22
168. find / -type f -perm -2000 -print
/* Find all SGID files */ 2005-03-22
169. find / -type f -perm -4000 -print
/* find all SUID files */ 2005-03-22
170. trap 'exit 0' 1 2 3 9 15
/* Trap specific signals and exit */ 2005-02-06
171. vi -x [filename]
/* Encrypt a file with vi editor */ 2006-04-19
Back to top
Setting Term Options
172. stty erase ^?
/* Set the delete key to delete a character */ 2005-03-22
173. stty erase ^H
/* Set the backspace to delete a character */ 2005-03-22
174. stty sane
/* Reset terminal after viewing a binary file. */ 2005-03-22
175. tput rmacs
/* Reset to standard char set */ 2005-03-22
Back to top
Snoop
176. snoop -d pcelx0
/* Watch all the packets on a device */ 2005-03-22
177. snoop -i /tmp/mylog -o /tmp/newlog host1
/* Filter out all the host1 packets and write them to a new logfile */ 2005-03-22
178. snoop -i /tmp/mylog -v -p101
/* Show verbose info on packet number 101 in the logfile */ 2005-03-22
179. snoop -i /tmp/mylog host1 host2
/* View packets from a logfile between hosts1 and host2 */ 2005-03-22
180. snoop -o /tmp/mylog pcelx0
/* Save all the packets from a device to a logfile */ 2005-03-22
181. snoop -s 120
/* Return the first 120 bytes in the packet header */ 2005-03-22
182. snoop -v arp
/* Capture arp broadcasts on your network */ 2005-03-22
183. snoop port [port-number]
/* Monitor particular port for traffic */ 2006-04-10
Back to top
Swap Files
184. mkfile -nv 10m /export/disk1/myswap
/* Makes an empty 10 Megabyte swapfile in /export/disk */ 2005-03-22
185. mkfile -v 10m /export/disk1/myswap
/* Makes a 10 Megabyte swapfile in /export/disk */ 2005-03-22
Back to top
Swap Space
186. swap -a /export/disk1/swapfile
/* Add a swap file */ 2005-03-22
187. swap -d /dev/dsk/c0t0d0s4
/* Delete a swap device */ 2005-03-22
188. swap -l
/* List the current swap devices */ 2005-03-22
189. swap -s
/* List the amount of swap space available */ 2005-03-22
Back to top
System Configuration
190. /usr/sbin/eeprom auto-boot? false
/* Changes eeprom autoboot? setting without going to Ok prompt */ 2005-03-22
191. /usr/sbin/eeprom diag-switch? true
/* Set the system to perform diagnostics on the next reboot. */ 2005-03-22
192. /usr/sbin/eeprom local-mac-address?=true
/* Multiple Port Network Card Setting */ 2005-03-22
193. /usr/sbin/grpck
/* Check /etc/group file syntax */ 2005-03-22
194. /usr/sbin/pwck
/* Check /etc/passwd file syntax */ 2005-03-22
195. /usr/sbin/sys-unconfig
/* Clear host specific network configuration information */ 2005-03-22
196. /usr/sbin/useradd
/* Add a new user to the system */ 2005-10-13
197. drvconfig ; disks
/* Adding hot-plug disks to system */ 2005-03-22
Back to top
System Information/Monitoring
198. /bin/echo "0t${stamp}>Y\n<Y=Y" | adb
/* Convert UNIX timestamp to something human-readable */ 2005-03-22
199. /usr/platform/`/bin/uname -i`/sbin/prtdiag -v
/* System Diagnostics */ 2005-03-22
200. /usr/sbin/eeprom
/* Show eeprom parameters */ 2005-03-22
201. /usr/sbin/prtconf -vp
/* Show system configuration details */ 2005-03-22
202. coreadm -e log
/* Report global core */ 2005-03-22
203. grep "\-root" /var/adm/sulog | grep -v \+ | tail -25
/* List most recent attempts to switch to superuser account. */ 2005-03-22
204. isainfo -bv
< SUN >
# isainfo -kv
< HP >
# getconf KERNEL_BITS
< AIX >
# bootinfo -y
/* Quickly checkout if machine is in 32 or 64 bit mode */ 2005-03-22
205. last
/* Tells who was or still is on the system */ 2005-03-22
206. logger -i
/* Log the process ID */ 2005-03-22
207. prtconf -pv | grep banner-name |awk -F\' ' { print $2 } ' | head -1
/* Show actual model name of machine */ 2005-03-22
208. prtpicl -v | grep wwn
/* A command to find persistent binding of storage */ 2006-06-20
209. psradm -f [processor id]
/* Take processor offline */ 2005-03-22
210. psrinfo | wc -l
/* Display number of processors */ 2005-03-22
211. sar -u
/* Report CPU Utilization */ 2005-03-22
212. sar [ -aA ] [ -o filename ] t [ n ]
/* Provides cumulative reports about system activity. */ 2005-03-22
213. telnet <remote machine> 13 | grep ':'
/* Get the time on remote Unix machine */ 2005-01-10
214. uname -a
/* Displays system information */ 2005-03-22
215. uname -X
/* Displays system information */ 2005-08-03
216. vmstat 10
/* Displays summary of what the system is doing every 10 seconds */ 2005-03-22
217. who -b
/* Displays the date of the last system reboot. */ 2005-03-22
218. 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. */ 2005-03-22
'개발 > Server Side' 카테고리의 다른 글
vmstat 주기적 로깅 (0) | 2013.05.15 |
---|---|
mysql status monitoring (0) | 2013.05.15 |
tomcat nio 설정 (0) | 2013.05.07 |
prompt 설정 (0) | 2013.05.06 |
sed & awk 사용법 (펌) (0) | 2013.04.29 |