zoukankan      html  css  js  c++  java
  • Linux常用命令

    TCP/UDP

    * TCP活动网络服务状态
        netstat -tnlp 
        netstat -tnlp | grep 7077
    

    防火墙

    * 查看防火墙状态
        service iptables status
    
    * 关闭防火墙
        service iptables stop
    
    * 查看防火墙开机启动状态
        chkconfig iptables --list
    
    * 关闭防火墙开机启动
        chkconfig iptables off
    

    解压缩

    * tar -zxvf filename -C dir
        C:指定要解压到的目的目录
    

    时区

    * cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
        修改为中国的东八区
    * vi /etc/sysconfig/clock
        ZONE="Asia/Shanghai"
        UTC=false
        ARC=false
    

    定时计划任务

    * crontab格式如下:
        For details see man 4 crontabs
        Example of job definition:
        .---------------- minute (0 - 59)
        |  .------------- hour (0 - 23)
        |  |  .---------- day of month (1 - 31)
        |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
        |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
        |  |  |  |  |
        *  *  *  *  *  command to be executed
    
    * 设定crontab计划任务也有两种方式:
        1. 写在/etc/crontab里
        代码:
        00 11 * * * root ntpdate 210.72.145.44
        每天11点与中国国家授时中心同步时间
        每天11点与中国国家授时中心同步时间
        当然前提是
        apt-get install ntpdate
        代码也可是
        00 11 * * * root ntpdate us.pool.ntp.org
        2. 使用命令crontab -e
            crontab -e 
                10 5 * * * root ntpdate us.pool.ntp.org;hwclock -w 
            这样每天5:10自动进行网络校时,并同时更新BIOS的时间
  • 相关阅读:
    jquery实现瀑布文字
    文本域、bootstrap-table显示以及MySQL三者间的换行符问题
    Mybatis框架的搭建和基本使用方法
    解决ajax多次绑定问题
    浅析JSONP与CROS技术解决跨域问题
    使用Ajax+nodejs实现页面头像上传功能
    自写滚屏组件
    express框架的ejs模板引擎渲染html页面
    自写轮播组件
    mousewheel事件细节
  • 原文地址:https://www.cnblogs.com/fuyiming/p/6160376.html
Copyright © 2011-2022 走看看