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

linuxϵͳ±à³Ì´úÂë1

#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/sysmacros.h>
#include <time.h>
#include <unistd.h>
#define TIME_STRING_BUF 50
char * timestring(time_t t,char *buf)
 {
   struct tm *local;
local=localtime((&t);
strftime(buf,TIME_STRING_BUF,"%c",local);
return buf;
  }
 int statfile(const char * file)
{
 struct stat statbuf;
char timebuf[TIME_STRING_BUF];
if (lstat(file,%statbuf))
{
 fprintf(stderr,"could not lstat %s:%s\n",file,stderror(errno));
return 1;
}
 printf("filename : %s\n",file);
printf("on device : major %d/minor %d  inode number: %ld\n",major(statbuf.st_dev),minor(statbuf,st_dev),statbuf .st_ino)) )
printf("size     :%-10ld   type :  %07o     permissons  :%05o",statbuf,st_size,statbuf .st_mode&S_IFMT,statbuf  .st_mode&~(S_IFMT));
printf("ower   :%d      group    :%d  number  of  links  :%d\n",statbuf   .st_uid,statbuf    .st_uid,statbuf    .st_gid,statbuf   .stnlink);
printf("change time :%s\n",timeString(statbuf  ,st_ctime ,timeBuf));
printf("modified time :%s\n",timeString(statbuf  ,st_ctime ,timeBuf));
printf("access time :%s\n",timeString(statbuf  ,st_ctime ,timeBuf));
return 0;
 int
main(int argc,const char **argv)
{
   int i;
   int rc=0;
for (i=1;i<argv;i++)
{
    rc|=statFile(argv[i]);
    if((argc-i)>1)
    printf("\n");
  }
return rc;
}


Ïà¹ØÎĵµ£º

LinuxÖÐALIGNºêµÄÔ­Àí

1. Òý×Ó
int a;  
int size = 8;
   
Èç¹ûÈÃaΪ(size =8)µÄÕûÊý±¶±íʾ³É¶þ½øÖÆÓ¦ÊÇʲôÑù×ÓÄØ£¿ÄǾÍÊÇÈÃÕâ¸öÊý±íʾ³É¶þ½øÖÆÊ±µÄ×îºóÈýλΪ0.
¶øÒª´ïµ½ÕâһĿ±ê£¬Ö»ÒªÏÂÃæÕâ¸öÊýÓëËü½øÐÐÓëÔËËã¾Í¿ÉÒÔÁË:
  11111111 11111111 11111111 11111000  
¶øÉÏÃæÕâ¸öÊýʵ¼ÊϾÍÊ ......

Linux LVM µÄʹÓÃÏê½â

welcome Linux LVM µÄʹÓÃÏê½â ÕªÒª£ºLinuxÓû§°²×°Linux²Ù×÷ϵͳʱÓöµ½µÄÒ»¸ö×î³£¼ûµÄÄÑÒÔ¾ö¶¨µÄÎÊÌâ¾ÍÊÇÈçºÎÕýÈ·µØ¸øÆÀ¹À¸÷·ÖÇø´óС£¬ÒÔ·ÖÅäºÏÊʵÄÓ²Å̿ռ䡣¶øÓöµ½³öÏÖij¸ö·ÖÇø¿Õ¼äºÄ¾¡Ê±£¬½â¾öµÄ·½·¨Í¨³£ÊÇʹÓ÷ûºÅÁ´½Ó£¬»òÕßʹÓõ÷Õû·ÖÇø´óСµÄ¹¤¾ß(±ÈÈçPatition MagicµÈ)£¬µ«Õâ¶¼Ö»ÊÇÔÝʱ½â¾ö°ì·¨£¬Ã»Óиù±¾½â¾öÎ ......

Linux diffÓëpatchµÄÉîÈë·ÖÎö

Linux diffÓëpatchµÄÉîÈë·ÖÎö
http://blog.csdn.net/vrix/archive/2009/08/25/4483906.aspx
diffµÄÊä³ö¸ñʽ·ÖΪ´«Í³¸ñʽºÍͳһ¸ñʽ
1)diffµÄ´«Í³¸ñʽÊä³ö.
############################################
cat before.txt
Êä³ö:
This is a line to be deleted
This is a line that will be changed
This is a line ......

linuxÒýµ¼¹ý³ÌÄÚÄ»


Linux Òýµ¼¹ý³ÌÄÚÄ»
 
 
Òýµ¼ Linux® ϵͳµÄ¹ý³Ì°üÀ¨ºÜ¶à½×¶Î¡£²»¹ÜÄúÊÇÒýµ¼Ò»¸ö±ê×¼µÄ x86 ×ÀÃæÏµÍ³£¬»¹ÊÇÒýµ¼Ò»Ì¨Ç¶ÈëʽµÄ PowerPC® »úÆ÷£¬ºÜ¶àÁ÷³Ì¶¼¾ªÈ˵ØÏàËÆ¡£±¾ÎĽ«Ì½Ë÷ Linux µÄÒýµ¼¹ý³Ì£¬´Ó×î³õµÄÒýµ¼µ½Æô¶¯µÚÒ»¸öÓû§¿Õ¼äÓ¦ÓóÌÐò¡£ÔÚ±¾ÎĽéÉܵĹý³ÌÖУ¬Äú½«Ñ§Ï°µ½¸÷ÖÖÓëÒýµ¼ÓйصÄÖ÷Ì⣬ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ