基本Unix shell知識介紹
今天,我們學了很久的Unix系統(tǒng)知識之后,我們來學下Unix shell的知識。這個是在Unix中要經常使用的知識,希望大家能夠好好的掌握。在這里,我們先介紹一下Unix的知識。
UNIX ,是一個強大的多用戶、多任務操作系統(tǒng),支持多種處理器架構,按照操作系統(tǒng)的分類,屬于分時操作系統(tǒng)。由于UNIX具有技術成熟、結構簡練、可靠性高、可移植性好、可操作性強、網絡和數(shù)據庫功能強、伸縮性突出和開放性好等特色,可滿足各行各業(yè)的實際需要,特別能滿足企業(yè)重要業(yè)務的需要,已經成為主要的工作站平臺和重要的企業(yè)操作平臺。
它主要安裝在巨型計算機、大型機上作為網絡操作系統(tǒng)使用,也可用于個人計算機和嵌入式系統(tǒng)。
幾中常見Unix shell在用戶目錄下的控制文件
1)korn shell (ksh) - .profile .kshrc
2)bourne shell (sh) - .profile
3)c shell (csh) - .cshrc .login
4)bash shell (bash) - .bash_profile .bash_login .profile
在/etc/skel下,保存了用戶的Unix shell的模版文件。用admintool創(chuàng)建用戶時系統(tǒng)不會將模版文件復制到用戶主目錄,而用useradd命令時系統(tǒng)會將相應用戶設立了的模板復制到用戶主目錄并改名為相應的配置文件,如果想改變環(huán)境,修改這個文件就可以了.
root的配置文件在/下,如果沒有,用戶可以自己創(chuàng)建.其他用戶的配置文件在用戶登陸目錄下.
用戶登陸會先讀系統(tǒng)標準配置文件,然后讀自己目錄下的文件,如果用戶設置和默認不同,就改變值,如果用戶沒有設置,就用默認值.
例如:bash進的讀取順序: $HOME/.profile-->/etc/profile
- bash is a bit different from sh.
- whenever the user log in the system, bash will look for .bash_profile; if it doesn't exist, it will look for bash_login; if it still doesn't exist, then it will look for .profile. if it can find none of them, finally it uses /etc/profile.
- of course, those files are under $ except /etc/profile.
到這里,我們就講解玩了Unix shell的基本知識,希望對大家的學習有所幫助。
【編輯推薦】