Linux安裝後基本設定 命令 date print or set the system date and time pwd return working directory name and print name of current/working directory useradd create a new user or update default new user information passwd update a user’s authentication[證明] tokens(s)[記號] ls list directory contents su run a shell with substitute[替代] user and group IDs whoami print effective[有效] userid exit cause[引發] normal process termination whatis search the whatis database for complete words[命令的簡介] df report file system disk space usage[使用] du estimate[估計,統計] file space usage fdisk 分區管理工具 hdparm get/set hard disk parameters[參數] [命令]command –help 用來找命令的協助 Ctrl+C 可強制中斷程式運行 登入使用者初始設定檔案為.bash_profile .bashrc[見附錄1] 登出使用者執行檔案為.bash_logout 根目錄各目錄作用: /bin 二進位檔案程式工具 /boot 系統啟動的必須檔案 /dev 放系統的裝置,Linux把外設,磁碟……看成檔案 /etc 放系統設定檔 /home 普通使用者的個人主目錄 /initrd 臨時目錄,初始化引導用的,一般不用 /lib 系統庫[類似windows dll庫] /lost+found 和windows垃圾箱一樣的功能 /misc 一般不用,不知道功能的東西可以放這裡 /mnt 掛載外部裝置的 /opt 安裝第三方軟體,一般大的資料庫,和伺服器可安裝在這 /proc 記憶體資訊 /root 超級管理員的目錄 /sbin 超級管理員使用的管理工具 /tmp 臨時檔案存取目錄 /usr 所有的使用者的公用資料、軟體和檔案 /var 放的是動態資料 網路設定 /etc/resolov.conf 儲存本機預設的網域名稱和DNS伺服器資訊 /etc/sysconfig/network 有hostname和IP協議 /etc/sysconfig/networking 包括主機基本網路資訊,用於系統啟動
/etc/sysconfig/network-scripts/ 此目錄下是系統啟動最初始化網路的資訊 /etc/sysconfig/network-scripte/ifcfg-eth0 參數說明如下: DEVICE=name name表示物理裝置的名字 IPADDR=addr addr表示賦給該卡的I P地址 NETMASK=mask mask表示網路遮罩 NETWORK=addr addr表示網路地址 BROADCE ST=addr addr表示廣播位址 ONBOOT=yes/no 啟動時是否啟用該卡 BOOTPROTO=proto proto取值可以是none(無須啟動協議)、bootp(使用bootp協議)、dhcp(使用DHCP協議) USERCTL=yes/no 是否允許非root使用者控制該裝置 ifconfig configure a network interface netconfig 網路設定的文本式的圖形工具 route show/manipulate[操作,使用] the IP routing[路由選擇] table 使用者環境設定 1、 使用者語言環境 locale get locale[本地] specific[詳細的] information 只要設定LANG就可以了,別的都和LANG一樣 /etc/sysconfig/i18n 語言設定檔案 2、/etc/sysconfig/hwconf 硬體資訊 kudzu detects[檢查] and configures new and/or changed hardware on a system 2、 啟動配置 chkconfig updates and queries[查詢] runlevel information for system services setup 一個文本圖形工具,可管理啟動時的配置(服務,防火牆等) ntsysv A tool to set the stop/start of system services in a runlevel.(層級)文本圖形 /etc/init.d 所有的啟動配置 /etc/rc*.d/ 各個層級配置 /etc/inittab 系統初始化的設定檔,決定用那個層級啟動 附錄1.bash_profile和.bashrc的什麼區別 /etc/profile:此檔案為系統的每個使用者佈建環境資訊 ,當使用者第一次登入時,該檔案被執行.
並從/etc/profile.d目錄的設定檔中搜集shell的設定.
/etc/bashrc:為每一個運行bash shell的使用者執行此檔案.當bash shell被開啟時,該檔案被讀取.
~/.bash_profile:每個使用者都可使用該檔案輸入專用於自己使用的shell資訊,當使用者登入時,該
檔案僅僅執行一次!預設情況下,他設定一些環境變數,執行使用者的.bashrc檔案.
~/.bashrc:該檔案包含專用於你的bash shell的bash資訊,當登入時以及每次開啟新的shell時,該
該檔案被讀取.
~/.bash_logout:當每次退出系統(退出bash shell)時,執行該檔案.