# find ~ -name core -exec file {} \£» -exec rm -i {} \£»
²é¿´Ê¹ÓÃÎļþµÄ½ø³Ì
# fuser -u /usr/my_application/foo
ËÑË÷×Ö·û´®
#grep "hello world" `find ./ -name "*" -print -exec file {} \£» |grep text | cut -d '£º' -f 1`
Ŀ¼
#alias dir='ls -Lla|grep ^d'
Êä³ö IP µØÖ·
#ifconfig | grep "inet addr" | grep -v "127.0.0.1" | awk '{print $2£»}' | awk -F'£º' '{print $2£»}'
°´Îļþ³¤¶ÈÅÅÐò
#ls -l | grep ^- | sort -nr -k 5 | more
#ls -lR | grep ^- | sort -nr -k 5 | more
¶þ½øÖÆÎļþÖеĿɴòÓ¡×Ö·û
# strings name of binary file
Ò»¸öÔµÄ×îºóÒ»¸öÐÇÆÚÌìÖ´ÐÐÈÎÎñ£º
18 * * * 0 [`date "+%d"` -gt 24] && /path/to/script
ÐÞ¸ÄÀ©Õ¹Ãû£º
# for f in *.abc£» do mv $f `basename $f .abc`.def £» done
²é¿´Ó²ÅÌÇé¿ö£º£¨Solaris£©
# iostat -En
Õû¸öĿ¼Ê÷¿½±´£º
# cd
# find . -depth -print | cpio -pudm
°´³¤¶ÈÅÅÐòĿ¼ÏÂËùÓÐÎļþ
# du -a | sort -n -r | more
¼ì²éÎļþÄÚÿÐÐÊÇ·ñÓÐÏàͬÁÐÊý
#awk '{print NF}' test.txt |sort -nu|more
È¥³ý¿ÕÐÐ
#sed -e '/^[ ]*$/d' InputFile >OutputFile
²é¿´½ø³ÌÕ¼ÓõĶÔÓ¦Îļþ inode ºÅ£¨Solaris£©
#/usr/proc/bin/pfiles
ɾ³ýÖ¸¶¨Óû§µÄËùÓнø³Ì
# kill -9 `ps -fu username |awk '{ print $2 }'|grep -v PID`
Bash ²Ù×÷¿ì½Ý¼ü£º
ctrl-l ¡ª¡ª clear screen
ctrl-r ¡ª¡ª does a search in the previously given commands so that you don't
have to repeat long command.
ctrl-u ¡ª¡ª clears the typing before the hotkey.
ctrl-a ¡ª¡ª takes you to the begining of the command you are currently typing.
ctrl-e ¡ª¡ª takes you to the end of the command you are currently typing in.
esc-b ¡ª¡ª takes you back by one word while typing a command.
ctrl-c ¡ª¡ª kills the current command or process.
ctrl-d ¡ª¡ª kills the shell.
ctrl-h ¡ª¡ª deletes one letter at a time from the command you are typing in.
ctrl-z ¡ª¡ª puts the currently running process in background£¬ the process
can be brought back to run state by using fg command.
esc-p ¡ª¡ª like ctrl-r lets you search through the previously given commands.
esc-. ¡ª¡ª gives the last command you typed.
ÎļþÃûÀïµÄ¿Õ¸ñÌæ»»ÎªÏ»®Ïß
# for i in $1 £» do mv "$i" `echo $i | sed 's/ /_/g'` £» done
²é¿´Ô¶³ÌÖ÷»úʱ¼ä
# telnet remotehostname 13|grep £º
Ö»ÏÔʾ top ÃüÁîµÄstates ÐÐ
#while true£» do top -d 2 | col -b | grep states£» sleep 10£» done
¼ÓËÙÏÔʾ¡¡tar ÎļþÄÚÈÝ
# tar tvfn
Èà Ŀ¼ÃûÒ²ÄÜ¡¡Spell Check
#shopt -s cdspell
µ±Êä´íÃüÁîʱ£¬ÏµÍ³»á×Ô¶¯½øÈëÀàËÆµÄĿ¼
²é¿´¡¡Sun ·þÎñÆ÷ÐͺÅ
# /usr/platform/`uname -m`/sbin/prtdiag -v | grep `uname -m`
ÔÚvi ÖÐÒ»ÐÐÎÄ×ÖǰºóÌí¼Ó×Ö·û
£º/^\£¨¡£*\£©/s//ÎÒÒª \1 Ìí¼Ó/
²éÕÒij°üº¬×Ö·û´®£¨Verita£©Èí¼þ°üµÄÏêϸÐÅÏ¢ £¨Solaris£©
pkginfo -l `pkginfo | grep -i VERITAS | awk '{print $2}'`
Sun µÄÒ»´ó¶Ñ½Å±¾
| ×ÔÓÉ¹ã¸æÇø |
| ¡¡ |