10¸ö×î¿áµÄLinuxµ¥ÐÐÃüÁî
ת×Ô£ºhttp://linuxtoy.org/archives/top-10-one-liners.html
ÏÂÃæÊÇÀ´×Ô Commandlinefu ÍøÕ¾ÓÉÓû§Í¶Æ±¾ö³öµÄ 10 ¸ö×î¿áµÄ Linux µ¥ÐÐÃüÁϣÍû¶ÔÄãÓÐÓá£
sudo !!
ÒÔ root ÕÊ»§Ö´ÐÐÉÏÒ»ÌõÃüÁî¡£
python -m SimpleHTTPServer
ÀûÓà Python ´î½¨Ò»¸ö¼òµ¥µÄ Web ·þÎñÆ÷£¬¿Éͨ¹ý http://$HOSTNAME:8000 ·ÃÎÊ¡£
:w !sudo tee %
ÔÚ Vim ÖÐÎÞÐèȨÏÞ±£´æ±à¼µÄÎļþ¡£
cd -
¸ü¸Äµ½ÉÏÒ»´Î·ÃÎʵÄĿ¼¡£
^foo^bar
½«ÉÏÒ»ÌõÃüÁîÖÐµÄ foo Ì滻Ϊ bar£¬²¢Ö´ÐС£
cp filename{,.bak}
¿ìËÙ±¸·Ý»ò¸´ÖÆÎļþ¡£
mtr google.com
traceroute + ping¡£
!whatever:p
ËÑË÷ÃüÁîÀúÊ·£¬µ«²»Ö´ÐС£
$ssh-copy-id user@host
½« ssh keys ¸´ÖƵ½ user@host ÒÔÆôÓÃÎÞÃÜÂë SSH µÇ¼¡£
ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq /tmp/out.mpg
°Ñ Linux ×ÀÃæ¼ÖÆΪÊÓƵ¡£
Ïà¹ØÎĵµ£º
Ò»¡¢ÒýÑÔ£º
±¾ÎĵµµÄÄÚÈݴ󲿷ÝÄÚÈݶ¼ÊÇ´ÓÍøÉÏÊÕ¼¯¶øÀ´£¬È»ºóÅäºÏһЩеĽØͼ£¨Äں˰汾£ºV2.4.19£©¡£ÔÚÿһÅäÖÃÏîºó»áÓÐÒ»¸öÑ¡ÔñÖ¸ÄϵIJ¿·Ý£¬ÓÃÀ´Ö¸µ¼´ó¼ÒÔõôÑù¸ù¾Ý×Ô¼ºµÄÇé¿öÀ´×öÏàÓ¦µÄÑ¡Ôñ£»»¹ÓÐÔÚÿһ¸ö´óÏîºÍÎĵµµÄ×îºó»áÓÐÒ»¸ö¾Ñé̸£¬ËüÊÇһЩ¸ßÊÖÃÇÔÚÓ¦¶ÔÎÊÌâºÍ´¦ÀíÌØÓÐÓ²¼þʱµÄһЩ¾Ñ飨Õâ¸ö»¹µ ......
ÒÔÏÂÊDZ¾ÈËÔÚѧϰlinux±à³Ìʱ²éÕÒ²¢ÕûÀíµÄһЩ¶«Î÷£¬Óë´ó¼Ò·ÖÏí£º
Vi´ó¼Ò¶¼ºÜÊìϤ£¬Ä³Ð©Çé¿öÏÂËüÊÇÎÒÃÇÔÚLinuxÏÂΨһ¿ÉÓõÄÎı¾±à¼Æ÷¡£ÆäʵÎÒÃÇƽʱËùÖ¸µÄVIÆäʵÊÇVIM£¨ViImproved£¬VIÔöÇ¿°æ£©¡£ÓÐÈ˳£³£ÄÃVIMºÍemacs±È½Ï£¬VIM¾¡¹Ü²»ÏóemacsÄÇÑùÓÐÄÇô¶àµÄ¹¦ÄÜ£¬µ«ÊDZÈemacs¸ü·½±ã¡¢ºÃÓá£VIM¼òµ¥Ò×Óã¬Ö»Òª¿´¿´V ......
Ò»¡¢dnotify»úÖÆ
1¡¢Ê¹ÓÃ
ͨ¹ý¶ÔÎļþÃèÊö·ûÉèÖüàÌýÐźÅʵÏÖ¡£
//ÉèÖÃÎļþÏàÓ¦ÐźÅ
fcntl(fd, F_SETSIG, SIGRTMIN + 1);
//ÉèÖøÃÎļþÒª¼àÌýʼþ
fcntl(fd, F_NOTIFY, DN_ACCESS|DN_MODIFY|DN_CREATE|DN_RENAME|DN_DELETE|DN_ATTRIB|DN_MUL ......
¡¾51CTO¾«Ñ¡ÒëÎÄ¡¿¶àÊýÓû§ÔÚ¸Õ¸Õ½Ó´¥Ä³¸ö×ÀÃæϵͳʱ£¬ÍùÍùÈÝÒ×·¸ºÜ¶à´íÎó¡£²»¹ýÈç¹ûËûÃÇ´ÓÒ»¿ªÊ¼¾ÍÁ˽âÄÄЩÊǹ²ÐԵĴíÎ󣬾ͿÉÒÔ°ÑÊÜ´ìµÄ¸Ð¾õ½µÖÁ×îµÍ¡£ÒÔÏÂÊÇÐÂÓû§ÔÚʹÓÃijЩ³£ÓÃLinux×ÀÃæϵͳʱÈÝÒ×·¸µÄÊ®´ó´íÎó¡£
1¡¢ÑÓÐøʹÓÃWindowsµÄ˼ά ÕâÊÇÒ»¸öÔÙÃ÷ÏÔ²»¹ýµÄ´íÎó¡£ÆÕͨÓû§Í¨³£Òâʶ²»µ½×Ô¼ºÔÚʹÓÃÒ»¸öÍêÈ«² ......