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

LinuxÏ»ùÓڶ˿ڵķþÎñ¼ì²é½Å±¾

#!/bin/bash
#program:Usingtostudythe[if...then...fi]program
#dsk2007/10/83:00
#content:Iwillusingthisprogramtoshowyousevices
#1.printtheprogram''sworkinyourscreen
echo "Now,the service of your Linux system will be detect!"
echo "The www,ftp,ssh,and sendmail pop3 will be detect!"
echo ""
#2.www
www=`netstat -ntlp | awk '{print $4}' | grep :80$`
if [ "$www" != "" ]; 
then
echo $www
echo "WWW is runing"
else
echo $www
echo "WWW is NOT runing"
killall -9 httpd
/usr/sbin/apachectl start
#service httpd start
fi
#3.ftp
ftp=`netstat -an | grep LISTEN | grep :21`
if [ "$ftp" != "" ]; then
echo $ftp
echo "FTP is runing "
else
echo "FTP is not runing"
killall -9 vsftpd
#service vsftpd start
/etc/init.d/vsftpd start
fi
#4.ssh
ssh=`netstat -ntlp | awk '{print $4}' | grep :22$`
#ssh=`netstat -an | grep LISTEN | grep :22`
if [ "$ssh" != "" ]; then
echo $ssh
echo "SSH is running"
else
echo "SSH is not running"
fi
#5.sendmail pop3
smtp=`netstat -an | grep LISTEN | grep :25`
pop3=`netstat -an | grep LISTEN | grep :110`
if [ "$smtp" != "" ] && [ "$pop3" != "" ]; then
echo "Send mail is OK!"
elif [ "$smtp" != "" ] && [ "$pop3" = "" ]; then
echo " Send mail have some problems of your pop3!"
elif [ "$smtp" = "" ] && [ "$pop3" != "" ]; then
echo "Send mail have so me problems of your smtp!"
else
echo "Send mail is NO Trunning!"
fi 


Ïà¹ØÎĵµ£º

linuxÖÐ jdk µÄÐ¶ÔØºÍ°²×°

zz http://yushan.javaeye.com/blog/261148
Ò».jdk1.4Ð¶ÔØ
ÓÉÓÚredhat Enterprise 5 ÖÐ×Ô´ø°²×°ÁËjdk1.4µÄ£¬ËùÒÔÔÚ°²×°jdk1.6ǰÎÒ°Ñjdk1.4µÄжÁË£¬²½ÖèÈçÏ£º
1.´ò¿ªÖÕ¶ËÊäÈë#rpm -qa | grep gcj
£¬ÆäÏÖʵÄÚÈÝÓУº
  java
-1.4.2-gci-compat.........
  java
-1.4.2-gcj-compat-devel.....(¾ßÌåÍüÁËÊÇʲà ......

Linux Çå³þ»ØÊÕÕ¾

ÔÚrootģʽÏÂ: # #delete files in trash # #date:2010-3-5 # #maker:tootwo # dir=/root/.Trash [ -d $dir ] x=$? y=0 if test $x -eq $y      then         (for i in $dir/*             do  &nbs ......

[»ù´¡]³£ÓÃlinuxÃüÁî ±¸²é

=================Îļþ²Ù×÷==================
²»Ê¹ÓÃfindÖ±½ÓʹÓÃͨÅä·û¶ÔÎļþ²Ù×÷£º
cp ./*/*attch* /testout_attch/
 
ÎļþÄÚÈÝÏÔʾ
head/tail:
¡¡¡¡## (1) displays the first 6 lines of a file
¡¡¡¡head -6 readme.txt
¡¡¡¡## (2) displays the last 25 lines of a file
¡¡¡¡tail -25 mail.txt
¡¡¡¡# ......

ÉîÈë·ÖÎöWindowsºÍLinux¶¯Ì¬¿âÓ¦ÓÃÒìͬ

ÕªÒª£º¶¯Ì¬Á´½Ó¿â¼¼ÊõʵÏÖºÍÉè¼Æ³ÌÐò³£Óõļ¼Êõ£¬ÔÚWindowsºÍLinuxϵͳÖж¼Óж¯Ì¬¿âµÄ¸ÅÄ²ÉÓö¯Ì¬¿â¿ÉÒÔÓÐЧµÄ¼õÉÙ³ÌÐò´óС£¬½ÚÊ¡¿Õ¼ä£¬Ìá¸ßЧÂÊ£¬Ôö¼Ó³ÌÐòµÄ¿ÉÀ©Õ¹ÐÔ£¬±ãÓÚÄ£¿é»¯¹ÜÀí¡£
µ«²»Í¬²Ù×÷ϵͳµÄ¶¯Ì¬¿âÓÉÓÚ¸ñʽ ²»Í¬£¬ÔÚÐèÒª²»Í¬²Ù×÷ϵͳµ÷ÓÃʱÐèÒª½øÐж¯Ì¬¿â³ÌÐòÒÆÖ²¡£±¾ÎÄ·ÖÎöºÍ±È½ÏÁËÁ½ÖÖ²Ù×÷ϵͳ¶¯Ì¬¿â¼¼Ê ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ