Linuxの習得すべきShell命令


きほんそうさ

  • ファジイクエリが実行中のプロセス:
  • $ps -ef|grep tomcat
  • 解凍tar.gz:
  • $tar -xzvf abc.tar.gz
  • 環境変数の変更:
  • $vi /etc/profile  // root  
             :export PATH="/home/abc/bin:$PATH"$source /etc/profile  //       
  • ファイルの検索:
  • $find / -name abc.sh
  • バックグラウンドでプログラムを実行する(ユーザーがログアウトした後も実行を維持する):
  • $nohup abc.sh &

    ファイアウォール関連


    CentOSファイアウォール

  • ポートを開く
  • $/sbin/iptables -I INPUT -p tcp --dport 22 -j ACCEPT  
    $/etc/rc.d/init.d/iptables save 

    コンピュータを再起動すると、ファイアウォールのデフォルトで22というポートが開きます.
  • 一時的にファイアウォールを完全に閉じ、機械を再起動しなくてもよい:
  • $/etc/init.d/iptables status                //        
    $/etc/init.d/iptables stop                    //        
    $/etc/init.d/iptables restart                //      
  • ファイアウォールを永続的に閉じる:
  • $chkconfig --level 35 iptables off   //              ;