linux »ù±¾ÃüÁî
ʹÓÃTAB¼ü
ÓÃÊó±ê¿½±´ºÍÕ³ÌùÌá¸ß²Ù×÷ËÙ¶È ×ó¼üÍ϶¯---¿½±´ Öмüµã»÷---Õ³Ìù
1¡¢mkdir ½¨Á¢ÐÂĿ¼Ãû ¼Ó“." ÔÚĿ¼ÃûǰΪÒþ²ØĿ¼£¨ls -a¿É²é¿´£©
rm -rf Ŀ¼Ãû ɾ³ýĿ¼¼°×ÓĿ¼ rm -- -eeɾ³ý-eeÎļþ »òÕß rm "ÎļþÃû"
2¡¢mv ÀÏÎļþÃû ÐÂÎļþÃû ¸Ä±äÎļþ/Ŀ¼Ãû×Ö
cp ÀÏÎļþÃû ÐÂÎļþÃû ¸´ÖÆĿ¼ -R£¨¸´ÖÆĿ¼£©
3¡¢halt ¹Ø»ú reboot ÖØÆð
4¡¢mount (-t iso9660) /dev/cdrom /mnt/cdrom À¨ºÅÀïΪָ¶¨ÎļþÀàÐÍ£¬Ò»°ã¿É²»Óã¬linuxÒ»°ã»á×Ô¶¯Ê¶±ðÎļþÀàÐÍ
umount /mnt/cdrom »ò umount /dev/cdrom ÔÚÈ¡³ö¹âÅÌ»òÈíÅÌʱ£¬±ØÐëÏÈÔËÐÐÕâÌõÖ¸Áî
5¡¢¹ÜµÀÃüÁ
“|” ls /dev | more /devĿ¼µÄÎļþÒ»Ò³²»ÄÜÏÔʾÍ꣬more¿ÉÒÔ¶àÒ³ÏÔʾÍê
ÓÃÎļþ¼Ç¼ls /dev µÄËùÓнá¹û
ls /dev >file.txt Ŀ¼ÀïûÓÐfile.txt Ôò»á´´½¨Ò»¸öfile.txtÎļþ£¬Ä¿Â¼ÀïÓеĻ°Ôò»á¸²¸Çfile.txt
ls /dev >>file.txt ÎÞÔò´´½¨ ÓÐÔòÔÚÎļþºóÃæ×·¼ÓÄÚÈÝ
cat >>friends <<"EOF" °Ñ½ÓÏÂÀ´ÊäÈëµÄÄÚÈݱ£´æµ½friendsÎļþÀïÃæ¡£ ÊäÈë“EOF”ʱ½áÊø
<< ¾ÍÊÇÏòÇ°ÃæµÄÃüÁî´«ËÍÒ»¸öÊý¾Ý
6 ¡¢cd ..¿É½øÈëÉÏÒ»²ãĿ¼
¡¡¡¡cd -¿É½øÈëÉÏÒ»¸ö½øÈëµÄĿ¼
¡¡¡¡cd ~¿É½øÈëÓû§µÄhomeĿ¼
7¡¢echo env grep
export ±äÁ¿=Öµ
8¡¢ ½ø³ÌÏà¹Ø£º
ps -A |grep comm ÏÔʾËùÓÐÔËÐеĽø³Ì ¼ìË÷ÊÇ·ñÓÐÎÒÃÇÖ¸¶¨µÄcommÔËÐÐ
top:ÏÔʾϵͳµÄ×î¸ß½ø³Ì¡£ »¹ÓÐ cpuµÄʹÓÃÇé¿ö¡¢Õ¼ÓÃÄÚ´æµÄ´óС¡¢ÔËÐÐʱ¼äµÈ
kill
9¡¢ lynx www.google.com ×Ö·û½çÃæµÄÍøÂçä¯ÀÀÆ÷
chmod -R +wrx ÎļþÃû/Ŀ¼Ãû ¸øÖ¸¶¨Îļþ/Ŀ¼¼ÓȨÏÞ
uname ²é¿´Äں˰汾
df ¼ì²é´ÅÅÌÊ£Óà¿Õ¼ä
du -m/-k ²é¿´Îļþ´óС
10¡¢id:ÏÔʾÓû§µÄϵͳ±êÖ¾¡¢±¨¸æÓû§Ãû¡¢Óû§ºÅ£¨ID£©¡¢×éÃû¡¢×éºÅ£¨GID)
11¡¢ln [²ÎÊý] Ô´Îļþ Ä¿±êÎļþ -d Ó²Á¬½Ó -s Ó÷ûºÅÁ´½Ó´úÌæÓ²Á´½Ó£¨ÈíÁ´½Ó£
Ïà¹ØÎĵµ£º
vi adduser.sh È»ºó°ÑÈçÏ´úÂëÌùÈë¡£±£´æµ½CVSROOTĿ¼Ï¡£
#!/bin/bash
#add cvs users
while [ -n "$(echo $1|grep '^_')"];
do
case $1 in
-u) param=$2
echo -e "$param:\c" >>passwd
shift ;;
-p) param=$2
echo -e `./passwdgen.pl $param`":cvsroot" >> passwd;;
*)
exit 1
esac
shift
......
\d £º´ú±íÈÕÆÚ£¬¸ñʽΪweekday month date£¬ÀýÈ磺"Mon Aug 1"
\H £ºÍêÕûµÄÖ÷»úÃû³Æ¡£ÀýÈ磺ÎҵĻúÆ÷Ãû³ÆΪ£ºfc4.linux£¬ÔòÕâ¸öÃû³Æ¾ÍÊÇfc4.linux
\h £º½öÈ¡Ö÷»úµÄµÚÒ»¸öÃû×Ö£¬ÈçÉÏÀý£¬ÔòΪfc4£¬.linuxÔò±»Ê¡ÂÔ
\t £ºÏÔʾʱ¼äΪ24Сʱ¸ñʽ£¬È磺HH£ºMM£ºSS
\T £ºÏÔʾʱ¼äΪ12Сʱ¸ñʽ
\A £ºÏÔʾʱ¼äΪ24 ......
1. Linux ½Å±¾±àд»ù´¡
1.1 Óï·¨»ù±¾½éÉÜ
1.1.1 ¿ªÍ·
³ÌÐò±ØÐëÒÔÏÂÃæµÄÐпªÊ¼£¨±ØÐë·½ÔÚÎļþµÄµÚÒ»ÐУ©£º
#!/bin/sh
¡¡¡¡·ûºÅ#!ÓÃÀ´¸æËßϵͳËüºóÃæµÄ²ÎÊýÊÇÓÃÀ´Ö´ÐиÃÎļþµÄ³ÌÐò¡£ÔÚÕâ ¸öÀý×ÓÖÐÎÒÃÇʹÓÃ/bin/shÀ´Ö´ÐгÌÐò¡£
¡¡¡¡µ±±à¼ºÃ½Å±¾Ê±£¬Èç¹ûÒªÖ´Ðиýű¾£¬»¹±ØÐëʹÆä¿ÉÖ´ÐС£
¡¡¡¡ÒªÊ¹½Å±¾¿ÉÖ´ÐУº
±àÒ ......
ʹÓÃTAB¼ü
ÓÃÊó±ê¿½±´ºÍÕ³ÌùÌá¸ß²Ù×÷ËÙ¶È ×ó¼üÍ϶¯---¿½±´ Öмüµã»÷---Õ³Ìù
1¡¢mkdir ½¨Á¢ÐÂĿ¼Ãû ¼Ó“." ÔÚĿ¼ÃûǰΪÒþ²ØĿ¼£¨ls -a¿É²é¿´£©
rm -rf Ŀ¼Ãû ɾ³ýĿ¼¼°×ÓĿ¼ rm -- -eeɾ³ý-eeÎļþ »òÕß rm "ÎļþÃû"
2¡¢m ......
umask()º¯Êý£º´Ëº¯ÊýµÄÖ÷Òª×÷ÓÃÊÇÔÚ´´½¨ÎļþʱÉèÖûòÕßÆÁ±ÎµôÎļþµÄһЩȨÏÞ¡£Ò»°ãÓëopen()º¯ÊýÅäºÏʹÓá£openº¯ÊýÔÐÍ£º
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
int open( const char * pathname, int flags);
int open( const char ......