LinuxÔ´ÂëÖеÄmktimeËã·¨½âÎö
ÎÒÃÇÖªµÀ£¬´ÓCMOSÖжÁ³öÀ´µÄϵͳʱ¼ä²¢²»ÊÇtime_tÀàÐÍ£¬¶øÊÇÀàËÆÓÚstruct tmÄÇÑù£¬ÄêÔÂÈÕʱ·ÖÃëÊÇ·Ö¿ª´æ´¢µÄ¡£
ÄÇô£¬Òª°ÑËüת»¯ÎªÏµÍ³±ãÓÚ´¦ÀíµÄtime_tÀàÐÍ£¬¾ÍÐèÒªËã·¨½øÐÐת»»¡£
ÎÒÃǶ¼ÖªµÀÎÒÃǵĹ«Àú»¹ÊDZȽϸ´Ôӵģ¬ÓдóÔÂСÔ£¬ÓÐÈòÄê·ÇÈòÄ꣬´¦ÀíÆðÀ´»áºÜÂé·³¡£
µ«ÊÇLinuxµÄÔ´´úÂë½ö½öÓÃÁ˶̶̵ļ¸ÐоÍÍê³ÉÁËÕâ¸ö¸´ÔÓµÄת»»£¨GaussËã·¨£©£¬ÊµÔÚÁîÈ˾ªÆæ¡£»°²»¶à˵£¬ÏÈ¿´Ô´´úÂ룺
include/linux/time.h
static
inline
unsigned
long
mktime
(
unsigned
int
year,
unsigned
int
mon,
unsigned
int
day,
unsigned
int
hour,
unsigned
int
min
,
unsigned
int
sec)
{
if
(
0 >
=
(
int
)
(
mon -
=
2)
)
{
/**/
/* 1..12 -> 11,12,1..10 */
mon +
=
12;
/**/
/* Puts Feb last since it has leap day */
year -
=
1;
}
return
(
(
(
(
unsigned
long
)
(
year/
4 -
year/
100 +
year/
400 +
367*
mon/
12 +
day)
+
year*
365 -
719499
)
*
24 +
hour /**/
/* now have hours */
)
*
60 +
min
/**/
/* now have minutes */
)
*
60 +
sec;
/**/
/* finally seconds */
}
¿´ÉÏÈ¥ÁîÈËÑÛ»¨çÔÂÒ£¬ºÁÎÞÍ·Ð÷¡£ÏÂÃæ¾ÍÈÃÎÒÃǶԸÃËã·¨×÷¾ßÌåµÄ·ÖÎö¡£
ÏȲ»¿´Ç°ÃæµÄ£¬Ö±½Ó¿´returnÄǾ䣬¸ÃʽÕûÌåÉϾßÓÐÕâÑùµÄ½á¹¹£º
T = ((X * 24 + hour) * 60 + min) * 60 + sec
Õâ˵Ã÷¸ÃËã·¨ÊÇÏÈËã³ö´Ó1970Äê1ÔÂ1ÈÕ¿ªÊ¼µÄÌìÊýX£¬ÔÙ½ø¶øÇó³ö¾ßÌåµÄʱ¼äÖµTµÄ¡£
 
Ïà¹ØÎĵµ£º
windowsÖ÷»úºÍLinuxÐéÄâ»úÉèÖÃÎļþ¼Ð¹²Ïí
µÚÒ»²½£º´ò¿ªÐéÄâ»ú µãvm-----install vmtools
µÚ¶þ²½£º¿ªÊ¼ÐéÄâ»úLinux
ÔÚÖն˼üÈëÒ»ÏÂÃüÁî
cp /mnt/cdrom/VMwareTools-6.0.0-45731.tar.gz /usr/tmp
cd /usr/tmp
tar xzvf VMwareTools-6.0.0-45731.tar.gz
cd vmware-tools-distrib
./vmware-install.pl
һ·»Ø³µ£¬µÈ¿´µ ......
¡¡¡¡ls
¡¡¡¡ls ÃüÁî¿ÉÒÔ˵ÊÇlinuxÏÂ×î³£ÓõÄÃüÁîÖ®Ò»¡£ËüÓÐÖÚ¶àµÄÑ¡ÏÆäÖÐÓкܶàÊǺÜÓÐÓõģ¬ÄãÊÇ·ñÊìϤÄØ£¿ÏÂÃæÁгöÁË ls ÃüÁîµÄ¾ø´ó¶àÊýÑ¡Ïî¡£
¡¡¡¡-a ÁгöĿ¼ÏµÄËùÓÐÎļþ£¬°üÀ¨ÒÔ . ¿ªÍ·µÄÒþº¬Îļþ¡£
¡¡¡¡-b °ÑÎļþÃûÖв»¿ÉÊä³öµÄ×Ö·ûÓ÷´Ð±¸Ü¼Ó×Ö·û±àºÅ(¾ÍÏóÔÚCÓïÑÔÀïÒ»Ñù)µÄÐÎʽÁгö¡£
¡¡¡¡-c Êä³öÎļþµÄ i ½Ú ......
NO
·ÖÀà
PS1
ÃüÁîÃû
Ó÷¨¼°²ÎÊý
¹¦ÄÜ×¢½â
1
ÏÔʾĿ¼ÐÅÏ¢
#
ls
ls -a
Áгöµ±Ç°Ä¿Â¼ÏµÄËùÓÐÎļþ£¬°üÀ¨ÒÔ.Í·µÄÒþº¬Îļþ
#
ls
ls -l»òll
Áгöµ±Ç°Ä¿Â¼ÏÂÎļþµÄÏêϸÐÅÏ¢
#
ls
ls -a
ÏÔʾËùÓÐÎļþ£¬°üº¬Òþ²Ø¡£
#
ls
ls -al
ÏÔʾËùÓÐÎļþµÄÏêϸÐÅÏ¢¡£
2
²é¿´Â·¾¶
#
pwd
pwd
......
-------------------------------------------------------------------------------------------------------
//By:yuyongbao
//QQ:673360056
LINUX Äں˽ṹÌå
struct attribute
{
const char * name;
struct module &nb ......
·find path -option [ -print ] [ -exec -ok command ] {} \;
#-print ½«²éÕÒµ½µÄÎļþÊä³öµ½±ê×¼Êä³ö
#-exec command {} \; -----½«²éµ½µÄÎļþÖ´ÐÐcommand²Ù×÷,{} ºÍ \;Ö®¼äÓпոñ
#-ok ºÍ-execÏàͬ£¬Ö»²»¹ýÔÚ²Ù×÷ǰҪѯ ......