自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

淺析Unix操作系統(tǒng)中常見shell

系統(tǒng) 其他OS
Shell在Unix操作系統(tǒng)中很重要,它定義了各種變量和參數(shù),并提供了許多在高階語言中才具有的控制結(jié)構(gòu),包括循環(huán)和分支。

在學(xué)習(xí)Unix操作系統(tǒng)很久之后,我們越來越了解Unix操作系統(tǒng),今天,我們要了解Unix操作系統(tǒng)中的Shell知識。首先我們來了解下Shell。

Shell俗稱殼(用來區(qū)別于核),是指“提供使用者使用界面”的軟件(命令解析器)。它類似于DOS下的command.com。它接收用戶命令,然后調(diào)用相應(yīng)的應(yīng)用程序。同時它又是一種程序設(shè)計語言。

Shell作為命令語言,它交互式解釋和執(zhí)行用戶輸入的命令或者自動地解釋和執(zhí)行預(yù)先設(shè)定好的一連串的命令;作為程序設(shè)計語言,它定義了各種變量和參數(shù),并提供了許多在高階語言中才具有的控制結(jié)構(gòu),包括循環(huán)和分支。

幾中常見shell在Unix操作系統(tǒng)用戶目錄下的控制文件

 

  1. 1)korn shell (ksh) - .profile .kshrc  
  2. 2)bourne shell (sh) - .profile  
  3. 3)c shell (csh) - .cshrc .login  
  4. 4)bash shell (bash) - .bash_profile .bash_login .profile 

在/etc/skel下,保存了用戶的shell的模版文件。用admintool創(chuàng)建用戶時Unix操作系統(tǒng)不會將模版文件復(fù)制到用戶主目錄,而用useradd命令時Unix操作系統(tǒng)會將相應(yīng)用戶設(shè)立了的模板復(fù)制到用戶主目錄并改名為相應(yīng)的配置文件,如果想改變環(huán)境,修改這個文件就可以了.

root的配置文件在/下,如果沒有,用戶可以自己創(chuàng)建.其他用戶的配置文件在用戶登陸目錄下.

用戶登陸會先讀Unix操作系統(tǒng)標(biāo)準(zhǔn)配置文件,然后讀自己目錄下的文件,如果用戶設(shè)置和默認(rèn)不同,就改變值,如果用戶沒有設(shè)置,就用默認(rèn)值.

例如:bash進的讀取順序: $HOME/.profile-->/etc/profile

 

  1. bash is a bit different from sh.  
  2. whenever the user log in the system, bash will look for .bash_profile;   
  3. if it doesn't exist, it will look for bash_login;   
  4. if it still doesn't exist, then it will look for .profile.  
  5. if it can find none of them, finally it uses /etc/profile.  
  6. of course, those files are under ${HOME} except /etc/profile. 

這樣,在Unix操作系統(tǒng)中,我們就完成了用戶登陸shell控制文件的知識講解內(nèi)容。

【編輯推薦】

  1. 解決掉你不要的Unix操作系統(tǒng)進程
  2. 利用引用管理Unix操作系統(tǒng)
  3. Unix操作系統(tǒng)元字符管理
  4. Unix操作系統(tǒng)進程管理
  5. Unix操作系統(tǒng)進程關(guān)閉方法
責(zé)任編輯:小霞
相關(guān)推薦

2010-04-07 11:31:25

Unix操作系統(tǒng)

2010-04-20 15:58:30

Unix操作系統(tǒng)

2010-04-14 16:45:15

Unix操作系統(tǒng)

2010-04-08 16:11:39

Unix操作系統(tǒng)

2010-04-19 17:44:56

Unix操作系統(tǒng)

2010-04-16 14:46:22

2010-04-07 16:15:04

Unix操作系統(tǒng)

2010-04-08 17:31:51

Unix操作系統(tǒng)

2010-04-08 17:43:44

Unix操作系統(tǒng)

2010-05-07 13:04:11

Unix Shell

2010-04-16 17:03:52

Unix操作系統(tǒng)

2010-04-16 16:29:57

Unix操作系統(tǒng)

2010-04-07 10:42:41

Unix操作系統(tǒng)

2010-04-14 18:01:00

Unix操作系統(tǒng)

2010-05-10 17:11:12

2010-04-13 12:27:44

Unix操作系統(tǒng)

2010-04-15 14:40:26

Unix操作系統(tǒng)

2010-04-08 16:18:22

Unix操作系統(tǒng)工具

2010-04-19 18:18:30

Unix操作系統(tǒng)

2010-04-09 11:24:38

Unix操作系統(tǒng)
點贊
收藏

51CTO技術(shù)棧公眾號