linuxĿ¼²Ù×÷º¯Êý£ÛתUC£Ý
ת×Ô£º
http://blog.chinaunix.net/u2/63316/showart_547992.html
LinuxϵÄĿ¼ÊÇÒÀÕÕ±ê×¼À´Êµ×÷µÄ£¬Òò´Ë£¬Äú¿ÉÒÔºÁÎÞÎÊÌâµØÒÆÖ³µ½ÈκÎÆäËüUNIXƽ̨¡£
--------------------------------------------------------------------------------
getcwd/getwd : È¡µÃÄ¿Ç°ËùÔÚĿ¼
--------------------------------------------------------------------------------
#include
char * getcwd(char *buf,size_t size);
buf½«»á·µ»ØĿǰ·¾¶Ãû³Æ¡£
ÈκεĴíÎó·¢Éú£¬½«»á·µ»ØNULL¡£Èç¹û·¾¶³¤¶È³¬¹ýsize£¬errnoΪERANGE¡£getcwd·µ»ØµÄÖµÓÀÔ¶ÊÇûÓÐsymbol linkµÄ¡£
--------------------------------------------------------------------------------
#include
char *getwd(char *buf);
getwdÊǸöΣÏյĺ¯Êý£¬Ò»°ã¶¼»áÇ¿ÁÒ½¨Òé²»ÒªÓã¬ÒòΪÄúÎÞ·¨È·¶¨×µÄĿ¼³¤¶ÈΪ¶àÉÙ¡£PATH_MAX¶¨ÒåÁË×µÄ·¾¶³¤¶È¡£ÔÚLinuxÏÂËùÒÔÌṩÕâ¸öº¯ÊýÖ÷ÒªÊÇÒòΪ¡¸´«Í³¡¹¡£
--------------------------------------------------------------------------------
//»ñȡϵͳĿ¼×î´ó³¤¶È
long pathconf(char* path, int flag);
--------------------------------------------------------------------------------
chdir/fchdir/chroot : ¸Ä±äÄ¿Ç°ËùÔÚĿ¼
--------------------------------------------------------------------------------
#include
int chdir(const char * pathname);
int fchdir(int fd);
chdir¸ù¾Ýpathname±ä¸üÄ¿Ç°µÄËùÔÚĿ¼£¬ËüÖ»¸Ä±ä¸Ã³ÌʽµÄËùÔÚĿ¼¡£
fchdir¸ù¾ÝÒÑ¿ªÆôµÄfd(file descriptor)Ŀ¼À´±ä¸ü¡£
//sample
/*¸ü¸Äµ±Ç°¹¤×÷Ŀ¼µ½Éϼ¶Ä¿Â¼*/
if(chdir("..")==-1){
perror("Couldn't change current working directory.\n");
return 1;
}
--------------------------------------------------------------------------------
#include
int chroot(const char * path);
chroot¸Ä
Ïà¹ØÎĵµ£º
0
Java WebÓ¦ÓÃÔÚARM Linuxƽ̨ÉϵÄʵÏÖ
Posted in ˶²©ÂÛÎÄ at ʮһÔ 12th, 2009 / No Comments »
Íõ࣬ÖÜÀ¼½£¬ÁõÀñ¶«£¬½âÔÆÏö
(À¥Ã÷Àí¹¤´óѧÐÅÏ¢¹¤³ÌÓë×Ô¶¯»¯Ñ§Ôº£¬ÔÆÄÏÀ¥Ã÷650051)
1ÒýÑÔ
Ëæ×ÅÍøÂçÐÅÏ¢¼¼ÊõµÄ·ÉËÙ·¢Õ¹£¬Web¼¼ÊõÔ½À´Ô½¶àµÄÓÃÔÚ¿ØÖÆÁìÓò£¬¿Í»§¶ËÖ»ÐèÁ¬½ÓÒÔÌ«Íø£¬È¡µÃ·ÃÎÊȨÏÞ£¬¾Í¿ÉÒÔ·Ã ......
²é¿´´ÅÅÌÒÔ¼°·ÖÇøÃüÁ
fdisk -l
Êä³ö½á¹ûÈçÏ£º
-----------------------------------------------------------------------
Disk /dev/sda: 160.0 GB, 160040803840 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot   ......
¹¦ÄÜÃèÊö£º
»ñÈ¡»òÕßÉèÖÃ
Óëij¸öÌ×½Ó×Ö¹ØÁªµÄÑ¡ ÏѡÏî¿ÉÄÜ´æÔÚÓÚ¶à²ãÐÒé
ÖУ¬ËüÃÇ×Ü»á³öÏÖÔÚ×îÉÏÃæµÄÌ×½Ó×ֲ㡣µ±²Ù×÷Ì×½Ó×ÖÑ¡Ïîʱ£¬Ñ¡ÏîλÓڵIJãºÍÑ¡ÏîµÄÃû³Æ±ØÐë¸ø³ö¡£ÎªÁ˲Ù×÷Ì×½Ó×Ö²ãµÄÑ¡ÏӦ¸Ã ½«²ãµÄÖµÖ¸¶¨ÎªSOL_SOCKET¡£ÎªÁ˲Ù×÷ÆäËü²ãµÄÑ¡Ï¿ØÖÆÑ¡ÏîµÄºÏÊÊÐ ......
linuxĿ¼˵Ã÷
¡¡
/bin
ÕâÊÇ·ÅÀýÈ磺 ls, mv, rm, mkdir, rmdir, gzip, tar, telnet, ¼° ftp µÈµÈ³£ÓÃ
µÄÖ´ÐеµµÄµØ·½£¨ÕâЩִÐеµµÄÖ´Ðз½·¨»áÔÚºóÃæÌáµ½£©£¬ÓÐʱºòÕâ¸öĿ¼µÄÄÚÈÝ
Óë /usr/bin ÊÇÒ»ÑùµÄ£¨ÓÐʱºòÉõÖÁ»áʹÓÃÁ¬½áµµÁ¨£©£¬ÊǸøÒ»°ãʹÓÃÕßʹÓõÄÖ´
ÐгÌÐò·ÅÖõÄËùÔÚ£¡
/boot
û´í£¬ÕâÀï¾ÍÊÇ·ÅÖÃÄã Linu ......
1.¿â¸ÅÊö
¿â¿ÉÒÔ·ÖΪ¾²Ì¬¿âºÍ¶¯Ì¬¿â£¬¾²Ì¬¿â±àÒëʱ±ØÐë´æÔÚ£¬³ÌÐòÔËÐÐʱ²»ÐèÒª¡£
¶¯Ì¬¿âÒ²³Æ¹²Ïí¿â£¬Æä´úÂë²»»áÁ´½Óµ½Ä¿±êÎļþÖ®ÖУ¬Ö»Ó屶¯Ì¬¿â¿É·ÃÎÊʱ£¬Ó¦ÓóÌÐò²ÅÄÜÕýÈ·µØÖ´Ðж¯Ì¬¿âº¯Êý¡£Ö´Ðж¯Ì¬¿âÓÐÁ½ÖÖ·½Ê½£ºÒþʽµ÷ÓúÍÏÔʾµ÷Óá£Òþʽµ÷ÓÃÒ²³Æ¹²Ïí¿âµÄ¾²Ì¬¼ÓÔØ£¬¶¯Ì¬¿âº¯ÊýÔÚÓ¦ÓóÌÐò¿ªÊ¼Ö´ÐÐʱ»á×Ô¶¯ÔØÈëÄڴ棬 ......