Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Linux »ñȡϵͳʱ¼ä

1.ʱ¼ä±íʾ
ÔÚ³ÌÐòµ±ÖÐ,ÎÒÃǾ­³£ÒªÊä³öϵͳµ±Ç°µÄʱ¼ä,±ÈÈçÎÒÃÇʹÓÃdateÃüÁîµÄÊä³ö½á¹û¡£Õâ¸öʱºòÎÒÃÇ¿ÉÒÔʹÓÃÏÂÃæÁ½¸öº¯Êý
time_t time(time_t *tloc);                    //ʱ¼ä¾«¶ÈΪÃë
char *ctime(const time_t *clock);            //½«ÃëÊýת»¯Îª×Ö·û´®
timeº¯Êý·µ»Ø´Ó1970Äê1ÔÂ1ÈÕ0µãÒÔÀ´µÄÃëÊý[×¢Ò⣬´Ëº¯Êý·µ»ØµÄʱ¼ä¾«¶ÈÊÇ“Ãë”]¡£´æ´¢ÔÚtime_t ½á¹¹Ö®ÖС£²»¹ýÕâ¸öº¯ÊýµÄ·µ»ØÖµ¶ÔÓÚÎÒÃÇÀ´ËµÃ»ÓÐʲôʵ¼ÊÒâÒå¡£Õâ¸öʱºòÎÒÃÇʹÓõڶþ¸öº¯Êý½«ÃëÊýת»¯Îª×Ö·û´®¡£Õâ¸öº¯ÊýµÄ·µ»ØÀàÐÍÊǹ̶¨µÄ:Ò»¸ö¿ÉÄÜֵΪ¡£ thu dec 7 14:58:59 2000 Õâ¸ö×Ö·û´®µÄ³¤¶ÈÊǹ̶¨µÄΪ26
time_tÀàÐÍʵ¼ÊÉÏÊÇÓÉtypedef¶¨ÒåµÄ£¬²¢²»ÊÇÒ»¸öÐÂÀàÐÍ£¬¶ÔÓÚ¶àÊýϵͳÀ´Ëµ£¬time_t¾ÍÊÇlong£¬¾ßÌå×Ô¼ºÊ¹ÓõÄϵͳÊÇÓÉÄÄÖÖÀàÐÍÅÉÉúµÄ£¬¿ÉÒÔÔÚtime.hÍ·ÎļþÀïÓÃtime_t×÷ΪÌõ¼þ²éÒ»²é¾ÍÖªµÀÁË¡£
ÀàËƵģ¬size_tÒ²ÊÇͬÑùµÄµÀÀí¡£
ÁíÍ⣺
struct tm * gmtime(const time_t *timer);
gmtime()º¯ÊýÊǽ«ÈÕÀúʱ¼äת»¯ÎªÊÀ½ç±ê׼ʱ¼ä£¨¼´¸ñÁÖÄáÖÎʱ¼ä£©£¬²¢·µ»ØÒ»¸ötm½á¹¹ÌåÀ´±£´æÕâ¸öʱ¼ä
struct tm * localtime(const time_t * timer);
localtime()º¯ÊýÊǽ«ÈÕÀúʱ¼äת»¯Îª±¾µØʱ¼ä
 
 
ʾÀý´úÂ룺
#include <time.h>  //×¢£º²»ÊÇ<sys/time.h> ·ñÔò±àÒë²»±¨´í£¬µ«ÔËÐб¨¶Î´íÎó
#include <stdio.h>
int main()
{
time_t now;
now = time(NULL);
printf("%s", ctime(&now));
return 0;
}
 
 
Êä³ö£º
Tue Jun 26 16:29:18 2007
Ö¸¶¨Ê±¼äµÄ·½·¨£º
#include "time.h"
#include "stdio.h"
#include "stdlib.h"
int main(void)
{
struct tm t;            //¶¨Òåtmʱ¼ä½á¹¹£¬ÓÃÀ´´æ´¢Ê±¼ä¸ñʽµÄÊý¾ÝÐÅÏ¢
time_t t_of_day;     //¶¨Òåtime_tʱ¼ä½á¹¹
t.tm_year=2006-1900;//ÒÔ1900ÄêΪ±ê×¼¼ÆËãʱ¼ä
t.tm_mon=6;                 //Ϊ½á¹¹Ìå³ÉÔ±¸³Öµ
t.tm_mday=1;
t.tm_hour=0;
t.tm_min=0;
t.tm_sec=1;
t.tm_isdst=0;
t_of_day=mktime(&t);//ʹÓÃm


Ïà¹ØÎĵµ£º

linuxϵͳ¹¤³ÌʦÃæÊÔÌâ(¸½´ð°¸)

1.²é¿´Linuxϵͳµ±Ç°µ¥¸ö¹²ÏíÄÚ´æ¶ÎµÄ×î´óÖµ£¨ÃüÁ
ipcs -m
ipcs -a
2.ÓÃʲôÃüÁî²éѯָ¶¨IPµØÖ·µÄ·þÎñÆ÷¶Ë¿Ú
ÌâÒâÓ¦¸ÃÊÇ nmap ºÍnbtscan ÃüÁîÀ´É¨°É¡£
3.crontabÖÐÓÃʲôÃüÁÒåij¸ö³ÌÐòÖ´ÐеÄÓÅÏȼ¶±ð
nice/renice£º½ø³ÌÖ´ÐÐÓÅÏȼ¶
¸ÅÄ
½ø³ÌÓÅÏȼ¶£ºÏµÍ³°´½ø³ÌÓÅÏȼ¶µÄ²»Í¬·ÖÅäCPUʱ¼ä£¬ÓÅÏȼ¶¸ßµÄ ......

ʹÓÃlinux·ÃÎÊhd.imgÎļþ

#!/bin/bash
#Key Words:linux0.11 bochs harddisk bash
#mount hdimg name:hdimage-devel
#mount point:/mnt/initrd
hdimg=hdimage-devel
mpoint=/mnt/initrd
if [ "$1" == "mount" ]
then
    #mount hdimg
    echo "$1 START"
   &n ......

ÔÚLinuxÖÐÖ´ÐÐ.sh½Å±¾£¬Òì³£/bin/sh^M

ÔÚLinuxÖÐÖ´ÐÐ.sh½Å±¾£¬Òì³£/bin/sh^M
www.firnow.com    ʱ¼ä £º 2009-07-29  ×÷ÕߣºÄäÃû   ±à¼­£ºtoman µã»÷£º  199 [ ÆÀÂÛ ]
-
-
ÔÚLinuxÖÐÖ´ÐÐ.sh½Å±¾£¬Òì³£/bin/sh^M: bad interpreter: No such file or directory¡£
 
·ÖÎö£ºÕâÊDz»Í¬ÏµÍ³±àÂë¸ñʽÒýÆðµÄ£ºÔÚwindowsÏ ......

ÔÚlinuxÏÂÊäÈ볤ÎļþÃûС¼¼ÇÉ

Tab Tab Tab
±ÈÈ磺ÓÐÒ»¸öÎļþµÄÃû×Ö½Ð×÷alsa-divers-0.39.tar.gz£¬Õ⻹²»ËãºÜ³¤°É¡£ µ±ÄãÐèҪƵ·±µÄÊäÈëÕâ¸öÎļþµÄÃû×ÖµÄʱºò£¬ÄѵÀÄã²»¾õµÃÕâÊÇÒ»ÖÖÎÞÒÔÃû×´µÄÍ´¿àÂð£¿ÄÇôÎÒÏë¶ÔÄã˵һ¾ä£º²»ÒªÐÄ·³£¬Äã¿ÉÒÔÊÔÒ»ÊÔÔÚÊäÈëalsaºó°´Ò»Ï£ÃapsLock¼üÉÏ·½µÄ£Ôab¼ü¡£ÔõôÑùʹÄãÑÛÇ°Ò»ÁÁ°É£¬linuxÒѾ­Ææ¼£°ãµÄ×Ô¶¯²¹È«ÁËÎļþÃû¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ