Linux VIʹÓÃ
viµÄʹÓÃÖ®»ã×Ü
¹¦ÄÜ×îÇ¿Ôڵıà¼Æ÷——vi
viÊÇËùÓÐUNIXϵͳ¶¼»áÌṩµÄÆÁÄ»±à¼Æ÷£¬ËüÌṩÁËÒ»¸öÊÓ´°É豸£¬Í¨¹ýËü¿ÉÒÔ±à¼Îļþ¡£µ±È»£¬¶ÔUNIXϵͳÂÔÓÐËùÖªµÄÈË£¬»ò¶à»òÉÙ¶¼¾õµÃvi³¬¼¶ÄÑÓ㬵«viÊÇ×î»ù±¾µÄ±à¼Æ÷£¬ËùÒÔÏ£Íû¶ÁÕßÄܺúðÑËüѧÆðÀ´£¬ÒÔºóÔÚUNIXÊÀ½çÀï±Ø½«³©ÐÐÎÞ×è¡¢ÓÎÈÐÓÐÓ࣬ÒòΪÆäËû¼¸ÖÖÎı¾´¦ÀíÆ÷²¢·ÇUNIX±ê×¼Å䱸¡£Ëµ²»¶¨±ðÈ˵ÄLinux»úÆ÷û°²×°joe»òpico£¬Èç¹ûÄú²»»ávi£¬ÄÇÄú¿ÉÄܾÍûéüÁË¡£
viµÄ»ù±¾¸ÅÄî
»ù±¾ÉÏvi¿É·ÖΪÈýÖÖ²Ù×÷״̬£¬·Ö±ðÊÇÃüÁîģʽ£¨Command mode£©¡¢²åÈëģʽ£¨Insert mode£©ºÍµ×ÏßÃüÁîģʽ£¨Last line mode£©£¬¸÷ģʽµÄ¹¦ÄÜÇø·ÖÈçÏ£º
1£® Comand mode£º¿ØÖÆÆÁÄ»¹â±êµÄÒƶ¯£¬×Ö·û»ò¹â±êµÄɾ³ý£¬Òƶ¯¸´ÖÆijÇø¶Î¼°½øÈëInsert modeÏ£¬»òÕßµ½Last line mode¡£
2£® Insert mode£ºÎ¨ÓÐÔÚInsert modeÏ£¬²Å¿É×öÎÄ×ÖÊý¾ÝÊäÈ룬°´EscµÈ¿É»Øµ½Comand mode¡£
3£® Last line mode£º½«´¢´æÎļþ»òÀ뿪±à¼Æ÷£¬Ò²¿ÉÉèÖñ༻·¾³£¬ÈçÑ°ÕÒ×Ö·û´®¡¢ÁгöÐкŵȡ£
²»¹ý¿ÉÒÔ°Ñvi¼ò»¯³ÉÁ½¸öģʽ£¬¼´Êǽ«Last line modeÒ²ËãÈëCommand mode,°Ñvi·Ö³ÉCommand ºÍInsert mode¡£
viµÄ»ù±¾²Ù×÷
?½øÈëvi
ÔÚϵͳÌáʾ·ûºÅÊäÈëvi¼°ÎļþÃû³Æºó£¬¼´¿É½øÈëviÈ«ÆÁÄ»±à¼»Ã棺
$ vi testfile
ÓÐÒ»µãÒªÌرð×¢Ò⣬¾ÍÊÇÄú½øÈëviÖ®ºóÊÇ´¦ÓÚ“Command mode”Ï£¬ÄúÒªÇл»µ½Insert mode²ÅÄÜÊäÈëÎÄ×Ö¡£³õ´ÎÓÃviµÄÓû§¶¼»áÏëÏÈÓÃÉÏÏÂ×óÓÒ¼üÒƶ¯¹â±ê£¬½á¹ûµçÄÔÒ»Ö±½Ð£¬°Ñ×Ô¼ºÆø¸ö°ëËÀ£¬ËùÒÔ½øÈëviºó£¬ÏȲ»ÒªÂÒ¶¯£¬×ª»»ÈëInsertºóÔÙ˵¡£
?Çл»ÖÁInsert mode±à¼Îļþ
ÔÚCommand modeÏ°´‘i’¡¢‘a’»ò‘o’Èý¼ü¾Í¿É½øÈëInsert mode¡£ÕâʱºòÄú¾Í¿ÉÒÔ¿ªÊ¼ÊäÈëÎÄ×ÖÁË¡£
i: ²åÈ룬´ÓÄ¿Ç°¹â±êËùÔÚÖ®´¦²åÈëËùÊäÈëµÄÎÄ×Ö¡£
a: Ôö¼Ó£¬Ä¿Ç°¹â±êËùÔÚµÄÏÂÒ»¸ö×Ö¿ªÊ¼ÊäÈëÎÄ×Ö¡£
o: ²åÈëеÄÒ»ÐУ¬´ÓÐÐÊ׿ªÊ¼ÊäÈëÎÄ×Ö¡£
?InsertµÄÇл»→Command mode£¬°´Esc¼ü
ÄúÄ¿Ç°´¦ÓÚInsert mode£¬Äú¾ÍÖ»ÄÜÒ»Ö±´ò×Ö¡£¼ÙÈçÄú·¢ÏÖ´ò´í×ÖÁË£¬ÏëÓùâ±ê¼üÍù»ØÒƶ¯£¬½«¸Ã×Öɾ³ý£¬¾ÍÒª°´ESC¼üת»»»ØCommand mode£¬ÔÙɾ³ýÎÄ×Ö¡£
?À뿪vi¼°´æÎļþ
ÔÚCommand modeÏ£¬¿É°´Ã°ºÅ“£º”¼üÈëÈëLast line mode£¬ÀýÈ磺
:w filename (ÊäÈë“w filename”£¬½«ÎÄÕ´æÈëÖ¸¶¨µÄÎļþÃûfilename)
:wq (ÊäÈë“wq”£¬ÒòΪ½øÈë֮ʱÒѾָ¶¨ÎļþÃûtestfile£¬ËùÒÔ»áдÈëtestfile²¢À뿪vi)
:q!
Ïà¹ØÎĵµ£º
/*
* ¸ÃÎļþʵÏÖϵͳµ÷ÓÃread£¬writeºÍlseek¡£
*/
/*
* linux/fs/read_write.c
*
* (C) 1991 Linus Torvalds
*/
#include <sys/stat.h>
#include <errno.h>
#include <sys/types.h>
#include <linux/kernel.h>
#include < ......
1. linuxÏÂÆô¶¯oracle
su - oracle
sqlplus /nolog
conn /as sysdba
startup
exit
lsnrctl start
exit
2. linuxϹرÕoracle
su - oracle
sqlplus /nolog
conn /as sysdba
shutdown immediate
exit
lsnrctl stop
exit
¿ÉÒÔʹÓÃlsnrctl ½øÈ¥ºóÓÃstatus²é¿´×´Ì¬£¬ÀàËÆ£º
lsnrctl
status
http://hi.baidu.c ......
1£¬ÍøÂçÕûÌåÁ÷Á¿²é¿´
ifconfig -s
cat /proc/net/dev
sar -n DEV/EDEV interval(ʱ¼ä¸ô) count(´ÎÊý)
nload -m [-d interface]
2£¬Ïêϸ²é¿´ÍøÂçÁ÷Á¿£¬±ÈÈç²é¿´Ä³Ò»¸öip/port£¬Ä³Ò»¸öÐÒé
iptraf£¬Îı¾´°¿Ú½çÃæ
ntop£¬webÍøÒ³½çÃæ ......
ÔÚlinuxÉÏ£¬jprofiler¿ÉÒÔ·ÖÎöjavaµÄÈí¼þϵͳ£¬oprofile¿ÉÒÔ·ÖÎöCµÄÈí¼þϵͳ¡£
oprofile¿ÉÒÔ˵ÊÇÒ»¸ö¹¤¾ß¼¯£¬°üº¬£º
ophelp£¬
opcontrol£¬
agent libraries£¬
opreport£¬
opannotate£¬
opgprof£¬
oparchive£¬
opimport¡£
³ ......
µ±Ö´ÐÐ
ls -l
»ò
ls -al
ÃüÁîºóÏÔʾµÄ½á¹ûÖУ¬×îÇ°ÃæµÄµÚ
2
¡«
10
¸ö×Ö·ûÊÇÓÃÀ´±íʾȨÏÞ¡£µÚÒ»¸ö×Ö·ûÒ»°ãÓÃÀ´Çø·ÖÎļþºÍĿ¼£º
d
£º±íʾÊÇÒ»¸öĿ¼£¬ÊÂʵÉÏÔÚ
ext2fs
ÖУ¬Ä¿Â¼ÊÇÒ»¸öÌØÊâµÄÎļþ¡£
££º±íʾÕâÊÇÒ»¸öÆÕͨµÄÎļþ¡£
l:
±íʾ ......