国产欧美日韩第一页|日本一二三不卡视频|在线精品小视频,亚洲第一免费播放区,metcn人体亚洲一区,亚洲精品午夜视频

Centos5 執行host提示command not found解決方法

2017-03-14 17:55:54 4222

Centos5 執行host提示command not found解決方法


本文章介紹了關(guān)于linux中Centos5 執行host提示command not found解決辦法有需要的朋友可參考一下

當顯示-bash: host: command not found的時(shí)候,我們就需要安裝對應的包了 


host這個(gè)程序是 bind-utils包里面的 


解決辦法 


所以要先安裝 bind-utils 



代碼如下:


yum install bind-utils 



總結 


很多的默認安裝包時(shí)都會(huì )有一些工具包不會(huì )安裝,所以大家安?前必須先了解一下相關(guān)包的基礎知識哦。


centos 提示command not found 或許因為權限問(wèn)題 


通過(guò)ssh登陸到centos5.4,切換到root賬戶(hù),發(fā)現很多命令提示command not found,今天才搞明白怎么回事,哎,看來(lái)需要從基礎一步一步來(lái)學(xué)習了。知識點(diǎn)涉及到用戶(hù)權限和用戶(hù)切換方面。 

joe為普通用戶(hù),root為超級用戶(hù)。 


現象如下: 

[joe@TRIXBOX1 ~]$ su 

口令: 

[root@TRIXBOX1 joe]# ifconfig 

bash: ifconfig: command not found 


su命令格式 

su [-|-p] [-c command] [username] 

- : 在切換當前用戶(hù)時(shí)切換用戶(hù)工作環(huán)境 

-p : 在切換當前用戶(hù)時(shí)不切換用戶(hù)工作環(huán)境,即保持當前用戶(hù)工作環(huán)境,此為缺省值 

-c command : 以指定的用戶(hù)身份執行命令 com m and 

username : 為要切換的用戶(hù),省略時(shí)表示 root 


su和su -的區別,這就是原因所在。 

# 切換為超級用戶(hù),不切換用戶(hù)身份 

[root@TRIXBOX1 joe]# su 

口令: 

[root@TRIXBOX1 joe]# env|egrep 'USER|LOGNAME|PATH|MAIL' 

USER=joe 

MAIL=/var/spool/mail/joe 

PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/joe/bin 

LOGNAME=joe 


# 切換為超級用戶(hù) root,同時(shí)切換用戶(hù)身份 

[root@TRIXBOX1 joe]# su - 

口令: 

[root@TRIXBOX1 ~]# env | egrep 'USER|LOGNAME|PATH|MAIL' 

USER=root 

MAIL=/var/spool/mail/root 

PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin 

LOGNAME=root 

[root@TRIXBOX1 ~]# 


su - 命令后就切換到root環(huán)境了 

[joe@TRIXBOX1 ~]$ su - 

口令: 

[root@TRIXBOX1 ~]# ifconfig 

eth0 Link encap:Ethernet HWaddr 00:15:60:9D:F1:A8 

inet addr:192.168.6.55 Bcast:255.255.255.255 Mask:255.255.255.0 

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 

RX packets:69028 errors:0 dropped:0 overruns:0 frame:0 

TX packets:39738 errors:0 dropped:0 overruns:0 carrier:0 

collisions:0 txqueuelen:1000 

RX bytes:102040430 (97.3 MiB) TX bytes:3030863 (2.8 MiB) 

Interrupt:169 Memory:e0500000-e0510000 

lo Link encap:Local Loopback 

inet addr:127.0.0.1 Mask:255.0.0.0 

UP LOOPBACK RUNNING MTU:16436 Metric:1 

RX packets:0 errors:0 dropped:0 overruns:0 frame:0 

TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 

collisions:0 txqueuelen:0 

RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) 

[root@TRIXBOX1 ~]# 


提交成功!非常感謝您的反饋,我們會(huì )繼續努力做到更好!

這條文檔是否有幫助解決問(wèn)題?

非常抱歉未能幫助到您。為了給您提供更好的服務(wù),我們很需要您進(jìn)一步的反饋信息:

在文檔使用中是否遇到以下問(wèn)題:
-->