把下面的if语句注释掉:
# Path manipulation
if [ "$EUID" = "0" ]then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
fi
修改为
# Path manipulation
# if [ "$EUID" = "0" ]then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
#fi
2.可以使用ln 命令连接
下图是 *** 作详细过程
[Blinux@bogon ~]$ ifconfigbash: ifconfig: command not found
[Blinux@bogon ~]$ ln -s /sbin/ifconfig /bin/ifconfigln: 正在创建指向“/sbin/ifconfig”的符号链接“/bin/ifconfig”: 权限不够
[Blinux@bogon ~]$ su
口令:
[root@bogon Blinux]# ln -s /sbin/ifconfig /bin/ifconfig[root@bogon Blinux]# su Blinux[Blinux@bogon ~]$ ifconfigeth0 Link encap:Ethernet HWaddr 00:0C:29:D4:AD:D6
inet addr:192.168.13.132 Bcast:192.168.13.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fed4:add6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:254 errors:0 dropped:0 overruns:0 frame:0
TX packets:193 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:28648 (27.9 KiB) TX bytes:20650 (20.1 KiB)
Interrupt:67 Base address:0x2000
loLink encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2471 errors:0 dropped:0 overruns:0 frame:0
TX packets:2471 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4570048 (4.3 MiB) TX bytes:4570048 (4.3 MiB)
3.用su – root方法
[Blinux@bogon ~]$ ifconfig
bash: ifconfig: command not found
[Blinux@bogon ~]$ su - root
口令:
[root@bogon ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:D4:AD:D6
inet addr:192.168.13.132 Bcast:192.168.13.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fed4:add6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:292 errors:0 dropped:0 overruns:0 frame:0
TX packets:228 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:32842 (32.0 KiB) TX bytes:24487 (23.9 KiB)
Interrupt:67 Base address:0x2000
loLink encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2471 errors:0 dropped:0 overruns:0 frame:0
TX packets:2471 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4570048 (4.3 MiB) TX bytes:4570048 (4.3 MiB)
在命令行模式下,获取当前主机名称: 在命令行模式下,获取IP地址: 在shell脚本中获取当前主机的主机名以及IP地址: 说明: `` 表示执行该语句,并返回执行后的结果; grep -A1 "eth0" 表示找出带有“eth0”的行,输出中除显示该行外,还显示之后的一行; awk 则是进行分割。linux查看ip命令:
Linux查看IP地址的命令--ifconfig
ifconfig命令用于查看和更改网络接口的地址和参数
$ifconfig -a
lo0: flags=849 mtu 8232
inet 127.0.0.1 netmask ff000000
hme0: flags=863 mtu 1500
inet 211.101.149.11 netmask ffffff00 broadcast 211.101.149.255
linux命令
是对Linux系统进行管理的命令。对于Linux系统来说,无论是中央处理器、内存、磁盘驱动器、键盘、鼠标,还是用户等都是文件,Linux系统管理的命令是它正常运行的核心,与之前的DOS命令类似。linux命令在系统中有两种类型:内置Shell命令和Linux命令。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)