linux api±Ê¼Ç£¨1£©£ºÅжÏÎļþÊÇ·ñ´æÔÚ
Èç¹ûÔÚlinux C\C++»·¾³ÏÂÅжÏij¸öÎļþÊÇ·ñ´æÔÚ£¬¿ÉÒÔʹÓÃaccessº¯Êý£º
#include <unistd.h>
#include <stdio.h>
int main()
{
const char* file1 = "access.cpp";
const char* file2 = "access1.cpp";
printf("%s:%d\n", file1, access(file1, F_OK));
printf("%s:%d\n", file2, access(file2, F_OK));
return 0;
}
¼ÙÉèÎļþaccess.cppÇÒaccess1.cpp²»´æÔÚ£¬ÄÇô½á¹ûΪ£º
access.cpp:0
access1.cpp:-1
Ïà¹ØÎĵµ£º
ÕâÁ½ÌìͬÊÂÔÚOcteon¿ª·¢°åÉϵ÷ÊÔLinux³ÌÐò£¬Óöµ½ÁËÒ»¸öÎÊÌ⣺ÎÞ·¨ÈÃgdbµ¥²½¸ú×Ù½øÈ뾲̬¿â£¨libcrypto.aºÍlibcvmx.a£©¶ÔÓ¦µÄÔ´Îļþ¡£
ÎÒ×Ô¼ºÔÚPCÉÏдÁËÒ»¸öС³ÌÐò½øÐÐÑéÖ¤£¬·¢ÏÖ¹ûÈ»ÊÇÕâÑù¡£Èç¹û°ÑÈ«²¿.oÎļþ£¨ÓÃ-ggdb3Ñ¡Ïî±àÒ룬´øµ÷ÊÔÐÅÏ¢£©Ö±½Ó±àÒë³É¿É ......
¹ØÓÚlinuxÏÂÁ½ÖÖÄÚ´æÒýµ¼Ä£Ê½µÄÇø±ð
Linux µÄ initrd ¼¼ÊõÊÇÒ»¸ö·Ç³£ÆÕ±éʹÓõĻúÖÆ£¬linux2.6 ÄÚºËµÄ initrd µÄÎļþ¸ñʽÓÉÔÀ´µÄÎļþϵͳ¾µÏñÎļþת±ä³ÉÁË cpio ¸ñʽ£¬±ä»¯²»½ö·´Ó³ÔÚÎļþ¸ñʽÉÏ£¬ linux Äں˶ÔÕâÁ½ÖÖ¸ñʽµÄ initrd µÄ´¦ÀíÓÐ׎ØÈ»µÄ²»Í¬¡£
initrd µÄÓ¢Îĺ¬ÒåÊÇ boot loader ......
Netstat -tln ÃüÁîÊÇÓÃÀ´²é¿´linuxµÄ¶Ë¿ÚʹÓÃÇé¿ö
/etc/init.d/vsftp start ÊÇÓÃÀ´Æô¶¯ftp¶Ë¿Ú~£¡
¿´Îļþ/etc/services
netstat
²é¿´ÒѾÁ¬½ÓµÄ·þÎñ¶Ë¿Ú£¨ESTABLISHED£©
netstat -a
²é¿´ËùÓеķþÎñ¶Ë¿Ú£¨LISTEN£¬ESTABLISHED£©
sudo netstat -ap
²é¿´ËùÓеķþÎñ¶Ë¿Ú²¢ÏÔʾ¶ÔÓ¦µÄ·þÎñ³ÌÐòÃû
nmap £¼É¨ÃèÀàÐÍ£¾£¼É¨Ã ......
µÚÒ»²¿·Ö µÚÈýÕ LinuxÖ÷»úµÄ¹æ»®
1.¼ÆËã»úÓ²¼þÅäÖûù±¾ÖªÊ¶£¨ÂÔ£©
2.LinuxÖеÄÓ²¼þÇý¶¯ºÅ£¬ÔÚLinuxÖÐÿ¸öÉ豸¶¼±»µ±³ÉÒ»¸öÎļþÀ´´¦Àí
IDEÓ²ÅÌ£º /dev/hd[a-d]
SCSIÓ²ÅÌ£º/dev/sd[a-p]
UÅÌ£º &nbs ......