linux shell ÃüÁîÖ®££££ sed µÄÓ÷¨
Ñ¡¶¨Ðеķ¶Î§£º£¬¶ººÅ
$ sed -n '/test/,/check/p'
example--ËùÓÐÔÚÄ£°åtestºÍcheckËùÈ·¶¨µÄ·¶Î§ÄÚµÄÐж¼±»´òÓ¡¡£
$ sed -n '5,/^test/p'
example--´òÓ¡´ÓµÚÎåÐпªÊ¼µ½µÚÒ»¸öÒÔtest¿ªÊ¼µÄÐÐÖ®¼äµÄËùÓÐÐС£
$ sed '/test/,/check/s/$/sed test/'
example--¶ÔÓÚÄ£°åtestºÍwestÖ®¼äµÄÐУ¬Ã¿ÐеÄĩβÓÃ×Ö·û´®sed testÌæ»»¡£
¶àµã±à¼£ºeÃüÁî
$ sed -e '1,5d' -e 's/test/check/'
example--(-e)Ñ¡ÏîÔÊÐíÔÚͬһÐÐÀïÖ´ÐжàÌõÃüÁî¡£ÈçÀý×ÓËùʾ£¬µÚÒ»ÌõÃüÁîɾ³ý1ÖÁ5ÐУ¬µÚ¶þÌõÃüÁîÓÃcheckÌæ»»test¡£ÃüÁîµÄÖ´ÐÐ˳Ðò¶Ô½á¹ûÓÐÓ°Ïì¡£Èç¹ûÁ½¸öÃüÁÊÇÌæ»»ÃüÁÄÇôµÚÒ»¸öÌæ»»ÃüÁӰÏìµÚ¶þ¸öÌæ»»ÃüÁîµÄ½á¹û¡£
$ sed --expression='s/test/check/' --expression='/love/d'
example--Ò»¸ö±È-e¸üºÃµÄÃüÁîÊÇ--expression¡£ËüÄܸøsed±í´ïʽ¸³Öµ¡£
´ÓÎļþ¶ÁÈ룺rÃüÁî
$ sed '/test/r file'
example--fileÀïµÄÄÚÈݱ»¶Á½øÀ´£¬ÏÔʾÔÚÓëtestÆ¥ÅäµÄÐкóÃ棬Èç¹ûÆ¥Åä¶àÐУ¬ÔòfileµÄÄÚÈݽ«ÏÔʾÔÚËùÓÐÆ¥ÅäÐеÄÏÂÃæ¡£
дÈëÎļþ£ºwÃüÁî
$ sed -n '/test/w file'
example--ÔÚexampleÖÐËùÓаüº¬testµÄÐж¼±»Ð´ÈëfileÀï¡£
×·¼ÓÃüÁaÃüÁî
$ sed '/^test/a\\--->this is a example'
example-- '--->this is a example'±»×·¼Óµ½ÒÔtest¿ªÍ·µÄÐкóÃ棬sedÒªÇóÃüÁîaºóÃæÓÐÒ»¸ö·´Ð±¸Ü¡£
²åÈ룺iÃüÁî
$ sed '/test/i\\new line--'
example--Èç¹ûtest±»Æ¥Å䣬Ôò°Ñ·´Ð±¸ÜºóÃæµÄÎı¾²åÈ뵽ƥÅäÐеÄÇ°Ãæ¡£
ÏÂÒ»¸ö£ºnÃüÁî
$ sed '/test/{ n; s/aa/bb/; }'
example--Èç¹ûtest±»Æ¥Å䣬ÔòÒƶ¯µ½Æ¥ÅäÐеÄÏÂÒ»ÐУ¬Ìæ»»ÕâÒ»ÐеÄaa£¬±äΪbb£¬²¢´òÓ¡¸ÃÐУ¬È»ºó¼ÌÐø¡£
±äÐΣºyÃüÁî
$ sed '1,10y/abcde/ABCDE/'
example--°Ñ1--10ÐÐÄÚËùÓÐabcdeת±äΪ´óд£¬×¢Ò⣬ÕýÔò±í´ïʽԪ×Ö·û²»ÄÜʹÓÃÕâ
Ïà¹ØÎĵµ£º
ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬Identi ......
linuxϽø³Ì¼äͨÐŵļ¸ÖÖÖ÷ÒªÊֶμò½é£º
¹ÜµÀ£¨Pipe£©¼°ÓÐÃû¹ÜµÀ£¨named pipe£©£º¹ÜµÀ¿ÉÓÃÓÚ¾ßÓÐÇ×Ôµ¹Øϵ½ø³Ì¼äµÄͨÐÅ£¬ÓÐÃû¹ÜµÀ¿Ë·þÁ˹ܵÀûÓÐÃû×ÖµÄÏÞÖÆ£¬Òò´Ë£¬³ý¾ßÓйܵÀËù¾ßÓеŦÄÜÍ⣬Ëü»¹ÔÊÐíÎÞÇ×Ôµ¹Øϵ½ø³Ì¼äµÄͨÐÅ£»
Ðźţ¨Signal£©£ºÐźÅÊDZȽϸ´ÔÓµÄͨÐÅ·½Ê½£¬ÓÃÓÚ֪ͨ½ÓÊܽø³ÌÓÐijÖÖʼþ·¢Éú£¬³ýÁËÓÃÓÚ½ø ......
ÔÚLinuxÏ°²×°ºÍʹÓÃMySQL
Ò»¡¢ÒýÑÔ
ÏëʹÓÃLinuxÒѾºÜ³¤Ê±¼äÁË£¬ÓÉÓÚûÓÐÓ²ÐÔÈÎÎñһֱҲûÓÐϵͳѧϰ£¬½üÈÕÓÉÓÚ¹¤×÷ÐèÒª±ØÐëʹÓÃLinuxϵÄMySQL¡£±¾ÒÔΪÓÐWindowsÏÂʹÓÃSQL ServerµÄ¾Ñ飬¾õµÃÔÚLinuxÏ°²×°MySqlÓ¦¸ÃÊÇÒ×Èç·´ÕƵÄÊ£¬¿ÉÔÚÕæÕý°²×°ºÍʹÓÃMySQLʱ×ßÁ˺ܶàÍä·£¬Óö¼ûºÜ¶àÎÊÌ⣬±Ï¾¹LinuxºÍWindows±¾Éí¾ÍÓ ......
Ò». Linuxϵͳ¸ÅÊö
1. Ó²Á´½ÓºÍÈíÁ´½Ó
Ó²Á´½ÓÏÞÖÆÓÚͬһ¸öÎļþϵͳÄÚ²¿£¬ÇÒ²»ÄܸøĿ¼´´½¨Ó²Á´½Ó
ÈíÁ´½ÓʵÏÖ¡£ Èç ln -s f1 f2£¬ ÃüÁîÖ´ÐÐʱ£¬ÏµÍ³´´½¨Ò»¸öеÄÈíÁ´½Ó£¬²¢°Ñ·¾¶Ãûf1дÈë¸ÃÁ´½Ó¡£È»ºóÔÚºÏÊʵÄĿ¼ÖвåÈëÒ»¸öеÄĿ¼Ï°üº¬Â·¾¶f2ÖеÄ×îºóÃû³Æ¡£ÒÔÕâÖÖ·½Ê½£¬ÈκηÃÎÊf2µÄÒýÓö¼¿ÉÒÔ×Ô¶¯±»×ª»»Îª¶Ôf ......
asctime£¨½«Ê±¼äºÍÈÕÆÚÒÔ×Ö·û´®¸ñʽ±íʾ£©
Ïà¹Øº¯Êý
time£¬ctime£¬gmtime£¬localtime
±íÍ·Îļþ
#include<time.h>
¶¨Ò庯Êý
char * asctime(const struct tm * timeptr);
º¯Êý˵Ã÷
asctime()½«²ÎÊýtimeptrËùÖ¸µÄtm½á¹¹ÖеÄÐÅϢת»»³ÉÕæʵÊÀ½çËùʹÓõÄʱ¼äÈÕ ......