CentOS常用操作/問題記錄

操作

  1. 命令行訪問網頁
    lynx www.baidu.com

  2. 下載
    wget XXX(下載地址)
    yum –y install xxx

  3. 解壓縮包
    tar -zxvf xxx.tar.gz

  4. 根據端口查詢PID
    netstat -antup | grep xxx
    kill PID

  5. 環境配置
    vim /etc/profile
    xxxx配置環境xxxx
    source /etc/profile使變量生效

問題

  1. /etc/hosts

    直覺的認爲,更改/etc/profile需要進行source,那麼更改/etc/hosts也需要source才生效,但是其實不是,如果source就會一直出現-bash: 127.0.0.1: command not found。最後才發現,source執行的也是bash,在父shell的環境中執行。而/etc/hosts只是簡單的文本文件,不是shell解析的,不能用source命令(笑哭……)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章