美文网首页
Linux基础之命令来了-ifconfig/echo

Linux基础之命令来了-ifconfig/echo

作者: 醉馬長洲 | 来源:发表于2018-08-17 21:35 被阅读0次

ifconfig

类似于ipconfig的命令,可查看网络接口的信息。但查看的内容以及可支持的操作各有千秋。

  • ifconfig 显示所有启用接口的信息

  • ifconfig int 显示特定接口的信息

    ifconfig int
  • ifconfig -s 同上,但只是简略显示

    ifconfig -s
  • ifconfig -a 显示所有接口信息

  • ifconfig -v 文档显示可以查看错误信息,有待后续学习

  • ifconfig int add[del] x:x:x:x:x 配置IPV6地址

  • ifconfig int x.x.x.x netmask x.x.x.x broadcast x.x.x.x 给接口配置地址\掩码\广播地址。
    配置网关是route add default gw x.x.x.x
    配置dhcp是 dhclient

  • ifconfig int up/down 设置接口up或down
    ifup int / ifdown int 与之等价

  • ifconfig int arp[-arp] 开启arp[关闭arp]

  • ifconfig int mtu 设置mtu

  • ifconfig int hw class macadd 配置MAC地址

  • ifconfig int media type 设置网卡协商速率

注意,ifconfig只是临时配置,如需完全改动还要在/etc/sysconfig/network-scripts/ 下的接口文件中做配置。


echo

echo 用于在shell中打印shell变量的值,也可直接输出指定的字符串。

  • 格式:

echo [SHORT-OPTION]...[STRING]...
echo [LONG-OPTION]

  • 选项:
    -n 显示不自动换行
    -e 启用解释功能(可使用转义字符)
    -E 关闭解释功能(默认选项)


    echo
  • 转义字符:
    \a 发出警告声;
    \b 删除前一个字符;
    \c 最后不加上换行符号;
    \f 换行但光标仍旧停留在原来的位置;
    \n 换行且光标移至行首;
    \r 光标移至行首,但不换行;
    \t 插入tab;
    \v 与\f相同;
    \ 插入\字符;
    \nnn 插入nnn(八进制)所代表的ASCII字符;

相关文章

  • Linux基础命令

    Linux基础命令 ifconfig命令 echo命令 tty命令 startx命令 export命令 pwd命令...

  • Linux基础之命令来了-ifconfig/echo

    ifconfig 类似于ipconfig的命令,可查看网络接口的信息。但查看的内容以及可支持的操作各有千秋。 if...

  • Linux系统上的命令使用格式

    Linux命令格式: ifconfig echo tty startx export pwd history sh...

  • 详细介绍以下命令

    说明Linux系统上命令的使用格式;详细介绍ifconfig、echo、tty、startx、export、pwd...

  • 详细介绍以下命令

    说明Linux系统上命令的使用格式;详细介绍ifconfig、echo、tty、startx、export、pwd...

  • 第一周4-6题

    4、说明Linux系统上命令的使用格式;详细介绍ifconfig、echo、tty、startx、export、p...

  • Linux命令学习之:echo命令

    Linux命令学习之:echo命令 简介 linux的echo命令, 在shell编程中极为常用, 在终端下打印变...

  • Linux系统查看IP地址

    进入终端输入命令:ifconfig windows下是:ipconfig linux是:ifconfig

  • linux网络管理

    linux网络配置 1.ifconfig命令 ifconfig ##查看或设定网络接口ifconfig de...

  • ip命令详解

    linux命令之ip 1、ip命令简介 ip 是个命令, ip 命令的功能很多!基本上它整合了 ifconfig ...

网友评论

      本文标题:Linux基础之命令来了-ifconfig/echo

      本文链接:https://www.haomeiwen.com/subject/kttxiftx.html