^_^

2008年12月15日星期一

linux常用设定及命令

  • 修改ip地址:
    [root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
    DEVICE=eth0
    BOOTPROTO=none
    HWADDR=00:30:1B:46:F6:B4
    ONBOOT=yes
    TYPE=Ethernet
    NETMASK=255.255.255.0
    IPADDR=192.168.101.234
    USERCTL=no
    IPV6INIT=no
    PEERDNS=yes
    GATEWAY=192.168.101.252
    [root@localhost ~]# /etc/init.d/network restart
  • 关闭firewall:
    [root@localhost ~]# /etc/init.d/iptables stop
    Flushing firewall rules:    [ OK ]
    Setting chains to policy ACCEPT: filter   [ OK ]
    Unloading iptables modules:  [ OK ]
    [root@localhost ~]# chkconfig iptables off
  • 关掉SELINUX
    /etc/selinux/config
    SELINUX=enforcing -> SELINUX=Disabled
  • service状态查询/启/停/重启
    service network status
    service network start
    service network stop
    service network restart
  • 添加linux用户
    adduser -s /use/bsh -d /home/username -p password username
    -s指定sh,-d指定用户主目录,-p指定密码
  • 显示硬盘空间
    du -sh ./*
    -s目录总和,-h用m为单位
  • 显示所有用户列表
    cat /etc/passwd |cut -f 1 -d :
本站文章除注明外,均为本站原创
转载请注明文章转载自: 大笨熊乐园 [ https://blog.foolbear.com/ ]
文章标题: linux常用设定及命令
文章地址: https://blog.foolbear.com/2008/12/linux.html

没有评论 :

发表评论

Related Posts with Thumbnails