linux network commands
1,ifconfig命令
ifconfig可设置网络设备的状态,或是显示目前的设置。
#ifconfig [网络设备] [down|up|-allmulti|-arp|-promisc] [add<地址>] [del<地址>] [<网络设备类型> <硬件地址>] [io_addr] [irq ] [media<网络媒介类型>] [mem_start<内存地址>]
[metric<数目>] [mtu<字节>] [netmask<子网掩码>] [tunnel<地址>] [-broadcast<地址>] [- pointopoint<地址>] [IP地址]
add<地址> 设置网络设备IPv6的IP地址。
del<地址> 删除网络设备IPv6的IP地址。
down 关闭指定的网络设备。
<网络设备类型><硬件地址> 设置网络设备的类型与硬件地址
#ifconfig eth0 hw ether XX:XX:XX:XX:XX:XX(更改eth0的mac地址)
io_addr 设置网络设备的I/O地址。
irq 设置网络设备的IRQ。
media<网络媒介类型> 设置网络设备的媒介类型。
mem_start<内存地址> 设置网络设备在主内存所占用的起始地址。
metric<数目> 指定在计算数据包的转送次数时,所要加上的数目。
mtu<字节> 设置网络设备的MTU。
netmask<子网掩码> 设置网络设备的子网掩码。
tunnel<地址> 建立IPv4与IPv6之间的隧道通信地址。
up 启动指定的网络设备。
-broadcast<地址> 将要送往指定地址的数据包当成广播数据包来处理。
-pointopoint<地址> 与指定地址的网络设备建立直接连线,此模式具有保密功能。
-promisc 关闭或启动指定网络设备的混杂(promiscuous)模式。
[IP地址] 指定网络设备的IP地址。
[网络设备] 指定网络设备的名称。
使用ifconfig和route命令更改IP设置:
#ifconfig eth0 down (关闭eth0)
#ifconfig eth0 hw ether XX:XX:XX:XX:XX:XX(临时更改eth0的mac地址,即时生效)
#ifconfig eth0 192.168.161.9 netmask 255.255.252.0 up (临时设置IP地址,子网掩码,即时生效)
#route add default gw 192.168.162.1 (临时设置网关,即时生效)
#vi /etc/sysconfig/network-scripts/ifcfg-eth0 (编辑配置文件,永久更改IP设置,重启生效)
#vi /etc/resolv.conf (编辑配置文件,设置DNS)
#ifconfig eth0 promisc (将eth0设置为混杂模式)
#ifconfig eth0 -promisc (取消混杂模式)
#ifconfig eth0 arp (打开eth0的arp解析)
#ifconfig eth0 -arp (关闭arp解析)
#ifconfig eth0:1 192.168.1.1 netmask 255.255.255.0
相关文档:
Gentoo Linux ALSA指南
1.
简介
什么是ALSA?
ALSA是Advanced Linux Sound Architecture,高级Linux声音架构
的简称,它在Linux操作系统上提供了音频和MIDI(Musical Instrument Digital Interface
,音乐设备数字化接口)的支持。在2.6系列内核中,ALSA已经成为默认的声音子系统,用来替换2.4系列 ......
linux目录架构
/ 根目录
/bin 常用的命令 binary file 的目錄
/boot 存放系统启动时必须读取的档案,包括核心 (kernel) 在内
/boot/grub/menu.lst GRUB设置
/boot/vmlinuz 内核
......
1. tr 命令的功能
tr命名是简化了的sed命令。其主要的功能包括:
a. 用一个字符来替换另外一个字符。
b. 删除字符串中的指定子串。
c. 合并字符串中重复串。
2. 常见的命令格式:
tr -c -d -s ["string1_to_translate_from"] ["string2_to_translate_to"] < input-file
-c 用字符串1中字符集的补集替换此字符集, ......