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

linux c ¶ÁÈ¡ÎļþÐÐÊý

linux c ¶ÁÈ¡ÎļþÐÐÊý²ÎÕÕwc ϵͳÃüÁî±àдµÄº¯ÊýÈçÏ£º
#include <fcntl.h>
#include <stdlib.h>
#define MAXBSIZE 65536
u_long file_wc(char *file)
{
register u_char *p;
register short gotsp;
register int ch, len;
register u_long linect, charct;
int fd;
u_char buf[MAXBSIZE];
if (file) {
if ((fd = open(file, O_RDONLY, 0)) < 0)
return -1;
for (gotsp = 1; len = read(fd, buf, MAXBSIZE);) {
if (len == -1)
return -1;
charct += len;
for (p = buf; len--;) {
ch = *p++;
if (ch == '\n')
++linect;
if (isspace(ch))
gotsp = 1;
else if (gotsp) {
gotsp = 0;
}
}
}
}
return linect;
}
²âÊÔc
#include <stdlib.h>
int main(int argc,char *argv[])
{
u_long row;
row= file_wc("test.unl");
printf("%d\n",row);
return 0;
}


Ïà¹ØÎĵµ£º

Linux iptableÎĵµ

×ÜÀÀ
ÓÃiptables -ADC À´Ö¸¶¨Á´µÄ¹æ
Ôò
£¬-AÌí¼Ó -Dɾ³ý -C ÐÞ¸Ä
iptables - [RI] chain rule num rule-specification[option]
ÓÃiptables - RI ͨ¹ý¹æÔòµÄ˳ÐòÖ¸¶¨
iptables -D chain rule num[option]
ɾ³ýÖ¸¶¨¹æÔò
iptables -[LFZ] [chain][option]
ÓÃiptables -LFZ Á´Ãû [Ñ¡Ïî]
iptables -[NX] chain
ÓÃ -NX ......

LinuxÏÂperlÄ£¿éµÄ°²×°

ÏȲο´Ò»ÏÂĿ¼ÏµÄREADMEÎĵµ
Ö÷ÒªÓÐÒÔϼ¸¸ö²½Ö裺
1) perl **.PL  Éú³Émakefile Îļþ
2) make
3) make test (this is optional£¬Èç¹ûÕⲽûɶÎÊÌâ,»áÏÔʾһÇÐok)
4) make install
³öÏÖµÄÎÊÌ⣬¶à¿´ÏÂÌáʾ£¬Ò»°ã¶¼ÊÇȱ°üÉÙ¿â ......

linux¹ÒÔØÐÂÓ²ÅÌ

fdisk -l ÃüÁî¿´µ±Ç°´ÅÅÌÐÅÏ¢
[root@roswell root]# fdisk /dev/sdb
Command (m for help): m  --´òÓ¡¸ÃÃüÁîµÄ²ÎÊý¹¦ÄÜÁбí
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibil ......

Linux °²×°mysql

 
1¡¢¶þ½øÖÆÎļþ£¨tar.gz£©°²×°
ÏÈ´´½¨Óû§ºÍÓû§×é
 su - root
groupadd mysql
useradd -g mysql mysql
½âѹ¶þ½øÖÆÎļþ¡£
gunzip -c filename | tar -xf -
¸´ÖÆÄ¿Â¼/home/mysqlµ½/usr/local£»
´´½¨mysqlÐí¿É±í£º
linux:/usr/local/mysql #scripts/mysql_install_db --user=mysql
ÉèÖöþ½øÖÆËùÓÐȨ£¬Ê ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ