LinuxÖеÄÑÓʱº¯Êý¼°»ñȡϵͳʱ¼äº¯Êý
Ó¦Óò㣺
#include <unistd.h>
1¡¢unsigned int sleep(unsigned int seconds); Ãë¼¶
2¡¢int usleep(useconds_t usec); ΢Ãë¼¶£º1/10^-6
#define _POSIX_C_SOURCE 199309
#include <a(const struct timespec *req, struct timespec *rem);
struct timespec {
time_t tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
};
// The value of the nanoseconds field must be in the range 0 to 999999999.
Äں˲㣺
include <linux/delay.h>
1¡¢void ndelay(unsigned long nsecs); ÄÉÃë¼¶£º1/10^-10
2¡¢void udelay(unsigned long usecs); ΢Ãë¼¶: 1/10^-6
3¡¢void mdelay(unsigned long msecs); ºÁÃë¼¶£º1/10^-3
linuxÏ»ñȡʱ¼äµÄÈô¸Éº¯Êý(z)
asctime£¨½«Ê±¼äºÍÈÕÆÚÒÔ×Ö·û´®¸ñʽ±íʾ£©
Ïà¹Øº¯Êý
time£¬ctime£¬gmtime£¬localtime
±íÍ·Îļþ
#include<time.h>
¶¨Ò庯Êý
char * asctime(const struct tm * timeptr);
º¯Êý˵Ã÷
asctime()½«²ÎÊýtimeptrËùÖ¸µÄtm½á¹¹ÖеÄÐÅϢת»»³ÉÕæÊµÊÀ½çËùʹÓõÄʱ¼äÈÕÆÚ±íʾ·½·¨£¬È»ºó½«½á¹ûÒÔ×Ö·û´®ÐÎ̬·µ»Ø¡£´Ëº¯ÊýÒѾÓÉÊ±Çø×ª»»³Éµ±µØÊ±¼ä£¬×Ö·û´®¸ñʽΪ:“Wed Jun 30 21:49:08 1993\n”
·µ»ØÖµ
ÈôÔÙµ÷ÓÃÏà¹ØµÄʱ¼äÈÕÆÚº¯Êý£¬´Ë×Ö·û´®¿ÉÄÜ»á±»ÆÆ»µ¡£´Ëº¯ÊýÓëctime²»Í¬´¦ÔÚÓÚ´«ÈëµÄ²ÎÊýÊDz»Í¬µÄ½á¹¹¡£
¸½¼Ó˵Ã÷
·µ»ØÒ»×Ö
Ïà¹ØÎĵµ£º
˵ÊÇexecϵͳµ÷Óã¬Êµ¼ÊÉÏÔÚLinuxÖУ¬²¢²»´æÔÚÒ»¸öexec()µÄº¯ÊýÐÎʽ£¬execÖ¸µÄÊÇÒ»×麯Êý£¬Ò»¹²ÓÐ6¸ö£¬·Ö±ðÊÇ£º
#include <unistd.h>
int execl(const char *path, const char *arg, ...);
int execlp(const char *file, const char *arg, ...);
int execle(const char *path, const c ......
²Î¿¼×ÊÁÏ £º linuxÄÚºËÉè¼ÆºÍʵÏÖ P13
likely£¨£©ºÍunlikely£¨£©ÊÇÄں˱àÒëʱÓÃÓÚÓÅ»¯ if ÅжÏÓï¾äµÄºê
likely£¨£©´ú±íÓÅ»¯
unlikely£¨£©´ú±í²»ÓÅ»¯
Ò»°ãΪÁËЧÂÊ ÓɳÌÐòÔ±×Ô¼ºÅжÏifÓï¾äÀïÃæµÄÄÚÈÝÊÇ·ñÒªÓÅ»¯£¬ÏÔÈ»Èç¹ûifÓï¾äÀïÃæµÄÄÚÈÝÓкܴóµÄ¸ÅÂÊ»áÖ´Ðе½¾Í¸ÃÓÅ»¯£¬²»È»¾Í²»±ØÓÅ»¯
if£¨likely£¨A != 0£©£©
£û
.. ......
ת×Ô£ºhttp://hi.baidu.com/zhangdaoxie/blog/item/d9f49f4a991f412b08f7efff.html
NetstatÓÃÓÚÏÔʾÓëIP¡¢TCP¡¢UDPºÍICMPÐÒéÏà¹ØµÄͳ¼ÆÊý¾Ý£¬Ò»°ãÓÃÓÚ¼ìÑé±¾»ú¸÷¶Ë¿ÚµÄÍøÂçÁ¬½ÓÇé¿ö¡£
Èç¹ûÎÒÃǵļÆËã»úÓÐʱºò½ÓÊܵ½µÄÊý¾Ý±¨»áµ¼Ö³ö´íÊý¾Ýɾ³ý»ò¹ÊÕÏ£¬ÎÒÃDz»±Ø¸Ðµ½Ææ¹Ö£¬TCP/IP¿ÉÒÔÈÝÐíÕâЩÀàÐ͵ĴíÎ󣬲¢Äܹ»×Ô¶¯ÖØ·¢Êý ......
xxxx.tar.gzÎļþʹÓÃtar´øzxvf²ÎÊý£¬¿ÉÒÔÒ»´Î½âѹ¿ª¡£XXXXΪÎļþÃû¡£ ÀýÈ磺
$tar zxvf xxxx.tar.gz
gzip -d
Óï ·¨£ºgzip [-acdfhlLnNqrtvV][-S <ѹËõ×Öβ×Ö·û´®>][-<ѹËõЧÂÊ>][--best/fast][Îļþ...] »ò gzip [-acdfhlLnNqrtvV][-S <ѹËõ×Öβ×Ö·û´®>][-<ѹËõЧÂÊ>][--best/fast][Ŀ¼]
²¹³äË ......