Chinaunix首页 | 论坛 | 博客
  • 博客访问: 238012
  • 博文数量: 38
  • 博客积分: 517
  • 博客等级: 下士
  • 技术积分: 419
  • 用 户 组: 普通用户
  • 注册时间: 2011-05-07 09:05
文章分类

全部博文(38)

文章存档

2018年(1)

2015年(1)

2014年(4)

2013年(11)

2012年(4)

2011年(17)

分类: LINUX

2013-09-06 23:40:26

网络管理
setup
service network restart
网卡配置文件/etc/sysconfig/network-scripts/ifcfg-eth0
ifconfig
ifconfig eth0
ifconfig eth0 10.10.10.10
ifconfig eth0:0 10.10.10.10 别名
网卡别名永久保存
cd /etc/sysconfig/network-scripts/
cp ifcfg-eth0 ifcfg-eth0:0
[root@localhost network-scripts]# cat ifcfg-eth0:0
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0:0
BOOTPROTO=none
HWADDR=00:0c:29:3d:f2:75
ONBOOT=yes
IPADDR=10.10.10.10
NETMASK=255.255.255.0
GATEWAY=10.10.10.1
TYPE=Ethernet

网卡的激活于停用
ifconfig eth0 down
ifconfig eth0 up

ifdown eth0
ifup eth0
ifdown eth0;ifup eth0

ping 
traceroute
route -n 查看路由表
route del default gw 10.10.10.1
route add default gw 10.10.10.1
arping 192.168.1.222 解析ip对应的mac
arp
ip addr show查看ip
mii-tool检查网卡是否有网线连接

主机名设定
hostname  查询
hostname zhb.com 临时修改
主机明配置文件: /etc/sysconfig/network
HOSTNAME=zhb.com
vim /etc/hosts 设置主机名和ip地址的对应关系
192.168.1.254   zhb.com
echo 1 > /proc/sys/net/ipv4/ip_forward 路由转发功能



uname -r
2.6.18-308.el5
主版本号.次版本号.修订版本号
次版本号:奇数 测试版  偶数 稳定版
模块的管理
lsmod ----------------------------查看系统加载模块
modinfo --------------------------查看模块信息
rmmod video-----------------------卸载模块
lsmod | grep video
insmod /lib/modules/2.6.18-308.el5/kernel/drivers/acpi/video.ko 
内核参数的配置文件/etc/sysctl.conf 
net.ipv4.ip_forward = 1  永久打开转发功能

创建快设备文件
mknod -m 640 /dev/sda7 b 8 7

查找命令
1.which
2.whereis
3.grep
4.locate(updatedb)
5.find
find / -name install.log--------------按照名字查找
find / -type b -ls--------------------按照类型查找
find / -links 2 -ls-------------------按照连接数查找
find /home/ -user jerry -ls-----------按照用户名查找文件,即是jerry用户拥有的文件
find /home/ -group robin -ls----------按照用户组查找文件,同上
find /home/ -nouser -ls------------------没有拥有者的文件
find /home/ -nogroup -ls-----------------没有用户组的文件

find /home/ \( -nogroup -a -nouser \)  -ls--------------------a 就是and ---o就是 or---
find /home/ -name aa.txt -exec rm {} \;
{} 代表find找到的文件路径 ;表示-exec命令结束
find /home/ -name tt.txt -ok rm {} \;----------------------ok---交互
find /home/ \( -nouser -a -nogroup \) -exec rm -r {} \;

大小
find /home/test/ -size 40M
find /home/test/ -size +30M---------------------------大于30M的文件 
find /home/test/ -size -30M---------------------------小于30M的文件
find /home/test/ -size +15M -a -size -35M--------------and
find /home/test/ -size +15M -o -size -35M--------------or
find /home/test/ -size -15M -o -size +35M 
时间
修改时间
touch -m -d 20130720 aa.txt 
-m 更改修改时间(modify时间)
-d 日期
-t 时间

find /home/test/ -mtime 5-------------------第五天的
find /home/test/ -mtime -5 -ls--------------五天以内的
find /home/test/ -mtime +5 -ls--------------五天之前的

find /home/test/ \( -mtime +3 -a -mtime -8 \) -ls----------------3天以前and 8天以内
find /home/test/ \( -mtime +3 -o -mtime -8 \) -ls----------------3天以前or 8天以内

权限
find /home/test/ -perm 600
find /home/test/ -perm +600------任意匹配
find /home/test/ -perm -600------完全匹配




阅读(1760) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~