1. 程式人生 > >CentOS 7 下 ifconfig command not found 解決辦法

CentOS 7 下 ifconfig command not found 解決辦法

用VMWare安裝了CentOS7,選擇了最小安裝包模式,安裝完畢之後想檢視一下本機的ip地址,發現報錯
# ifcon
-bash: ifconfig: command not found

谷歌了一下,整理了一下解決思路

  1.  檢視ifconfig命令是否存在

     檢視 /sbin/ifconfig是否存在

  2. 如果ifconfig命令存在,檢視環境變數設定    

#echo $PATH

       如果環境變數中沒有包含ifconfig命令的路徑

        臨時修改環境變數:在shell中輸入

$export PATH = $PATH:/sbin

       然後再輸入ifconfig命令即可,但是這只是臨時更改了shell中的PATH,如果關閉shell,則修改消失,下次還需要重複如上操作


        永久修改PATH變數使之包含/sbin路徑:

        開啟/etc/profile檔案,在其中輸入export PATH=$PATH:/sbin,儲存並重啟即可,這樣一來,PATH路徑永久修改成功,以後任何時候只輸入ifconfig命令即可

  3. 如果ifconfig命令不存在

yum upgrade
yum install net-tools

相關推薦

CentOS 7 ifconfig command not found 解決辦法

用VMWare安裝了CentOS7,選擇了最小安裝包模式,安裝完畢之後想檢視一下本機的ip地址,發現報錯 # ifcon -bash: ifconfig: command not found 谷歌了一下,整理了一下解決

【學習筆記】CentOS 7.5 網路連線問題:ifconfig command not found解決

問題描述        在VMware上裝的CentOS-7-x86_64-DVD-1804.iso,網上搜了一下原因,可能是CentOS 7.5的最小化安裝少了一些工具,比如 ifconfig 及 netstat 等。因此解決辦法很簡單,把它們安裝上就好了。首先判斷一下是不

CentOS7解決ifconfig command not found辦法(轉)

解決辦法如下:  1、輸入ip addr 確認IP地址是否設定正常,設定好如下所示,如果沒有獲取到IP地址則設定一個即可。  2、確認sbin目錄是否存在。 cd /sbin 1 3、確認ifconfig命令是否未安裝  在sbin目錄下輸入ls,

Docker進入容器後使用ifconfig等命令“command not found解決辦法

bar tab fault -a mage ont bsp tools net 當進入一個容器後,使用ifconfig、ip addr等命令時,出現如下“command not found”: 解決辦法:

ifconfig eth0命令出現command not found&解決辦法&匯入命令路徑

我們在使用ifconfig eht0命令檢視網路IP的時候, 會出現command not found,這個訊息提示。 而且root許可權也是沒有用,這是什麼問題呢,正常執行命令是不需要輸入路徑的,除非環境變數中沒有才會手動寫入目錄,那麼如何手動寫入目錄呢

升級10.12後使用CocoaPod出現-bash: pod: command not found 解決辦法

升級10.12後使用CocoaPod出現-bash: pod: command not found 解決辦法 升級10.11後,執行pod命令出現: -bash: pod: command not found 解決辦法: sudo gem ins

linux修改/etc/profile出錯command not found解決辦法

linux修改/etc/profile出錯導致所有命令都command not found的解決辦法 執行命令 export PATH=/usr/bin:/usr/sbin:/bin:/sbin

zabbix_get :command not found 解決辦法

zabbix_get 找不到命令是因為沒有安裝上zabbix_get ,解決辦法: 1.yum list all |grep zabbix 返回一個列表,表中出現 zabbix-get.x86_84 2.yum install zabbix-get.x86_64 z

HOSTCC scripts/basic/fixdep /bin/sh: line 1: gcc: command not found解決辦法

今天學習準備編譯gcc遇到以下錯誤解決辦法(答案來自http://341719xubin.blog.163.com/blog/static/132920793200910201302657/)輸入make之後,報錯,內容如下: [[email protected]

bash: __vte_prompt_command: command not found解決辦法

今天不知道做什麼操作,只要執行命令就會出現bash: __vte_prompt_command: command not found的提示,根據網上的資料,找到了__vte_prompt_co

bash:yum:command not found 解決辦法

最近在學rhel7,不知道怎麼回事,今天突然yum不能用了, 提示: bash:yum:command not found

CentOS 7.0解決ifconfig: command not found的方法

使用 最小 分享圖片 bin ifconf src mman 技術 centos 在CentOS7.0中輸入ifconfig命令會遇到-bash: ifconfig: command not found。 在CentOS最小安裝時是沒有附帶ifconfig,我們

【親測】<g++/gcc>CentOSg++: command not found問題的解決(c++環境安裝)

fin define time version csdn cannot result clas 代碼 CentOS下g++: command not found問題的解決 2017年02月27日 18:09:06 閱讀數:5174 標簽: centos

【linux】CentOS 7 使用ifconfig命令報錯:-bash: ifconfig: command not found;ip/ifcongif命令檢視網路資訊的使用

目錄 一、ip命令檢視網路資訊 二、CentOS 7啟用ifconfig命令 三、ifconfig命令檢視網路資訊 一、ip命令檢視網路資訊 (1)輸入命令檢視網絡卡資訊,找到網絡卡名稱,可以看到該網絡卡已經分配到IP地址,輸入命令: ip addr &nbs

Centos出現-bash: unzip: command not found解決辦法

沒有 找到 安裝 zip centos and 壓縮 command nbsp 利用unzip命令解壓縮的時候,出現-bash: unzip: command not found的錯誤。 unzip——命令沒有找到,其原因肯定是沒有安裝unzip。 利用一句命

centos7 最小化安裝ifconfig提示command not found解決方法

images 地址 a20 ifconf 分享圖片 bee 方法 ash p地址 問題:centos7 最小化安裝後minimal install 想查看主機網卡信息ifconfig提示:-bash:ifconfig:command not found 要如何解決? 附圖

ifconfig: command not foundCentOS專版,其他的可以參考)

ifconfig: command not found 檢視path配置(echo相當於c中的printf,C#中的Console.WriteLine) echo $PATH 解決方案1:先看看是不是root使用者,如果不是就 su 切換到root使用者 su 解決方案

Mac OS X 終端系統命令丟失提示 command not found 解決方法

  事件的起因是我在 ~/.bash_profile 裡添加了 ~/.composer/vendor/bin 這個東西導致,或許是 OS X 10.11 的 bug?   先說說 Mac OS

Linuxcommand not found錯誤(解決方法)

當我們在 Linux下執行一個命令時,報   -bash:  XXXX: command not found,這和Windows是相同的道理,都是環境變數惹的禍, 就是說你的 命令的 執行檔案不在 /

ubuntu-18.04.2 查看IP提示 Command 'ifconfig' not found 解決方案

9.png http ubun con nbsp .com com all ins 在ubuntu-18.04.2 終端輸入ifconfig 如下提示: 我們可以根據提示得知是沒有ifconfig 這個命令 下載net-tools 在終端輸入:sudo ap