码迷,mamicode.com
首页 > 系统相关 > 详细

《鸟哥的Linux私房菜》学习笔记(2)——Bash特性

时间:2014-08-06 18:56:02      阅读:673      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   使用   io   strong   ar   cti   

bash及其特性:

  离用户最近的程序是shell,shell 是外壳的意思,本身也是一种可执行程序。广义上的shell包含两类GUI和CLI。

  GUI:Gnome,KDE,Xface

  CLI:sh,csh,ksh,bash,tcsh,zsh

  当有多个用户登陆的时候,会有多个进程,进程之间彼此互不相干,因为对于每个进程来说,它只认为当前主机上只有自己和内核存在。但是只有一个shell程序。linux允许一个用户账号登陆多次 。

  进程是程序的副本,进程是程序执行的实例,是有生命周期的,由内核进行管理。

  用户工作环境,多个用户尽管使用的都是shell程序,但是各个用户的工作环境设定却可以各不相同,只不过默认情况下除了管理员,都是一样的。

  shell,子shell。可以在一个shell中在启动一个子shell。下面的通过pstree命令可以看出该关系,如果退出到上一层bash,可以用exit命令。退到最上一层时候,会退出登陆。

[hao@hao ~]$ bash
[hao@hao ~]$ pstree
init-+-NetworkManager-+-dhclient
     |                `-{NetworkManager}
     |-abrtd
     |-acpid
     |-atd
     |-auditd---{auditd}
     |-automount---4*[{automount}]
     |-bonobo-activati---{bonobo-activat}
     |-certmonger
     |-clock-applet
     |-console-kit-dae---63*[{console-kit-da}]
     |-crond
     |-cupsd
     |-2*[dbus-daemon---{dbus-daemon}]
     |-2*[dbus-launch]
     |-devkit-power-da
     |-gconf-im-settin
     |-gconfd-2
     |-gdm-binary-+-gdm-simple-slav-+-Xorg
     |            |                 |-gdm-session-wor-+-gnome-session-+-abrt-applet
     |            |                 |                 |               |-bluetooth-apple
     |            |                 |                 |               |-evolution-alarm
     |            |                 |                 |               |-gdu-notificatio
     |            |                 |                 |               |-gnome-panel
     |            |                 |                 |               |-gnome-power-man
     |            |                 |                 |               |-gnome-volume-co
     |            |                 |                 |               |-gpk-update-icon
     |            |                 |                 |               |-metacity
     |            |                 |                 |               |-nautilus
     |            |                 |                 |               |-nm-applet
     |            |                 |                 |               |-polkit-gnome-au
     |            |                 |                 |               |-python
     |            |                 |                 |               |-restorecond
     |            |                 |                 |               `-{gnome-session}
     |            |                 |                 `-{gdm-session-wo}
     |            |                 `-{gdm-simple-sla}
     |            `-{gdm-binary}
     |-gdm-user-switch
     |-gnome-keyring-d---2*[{gnome-keyring-}]
     |-gnome-screensav
     |-gnome-settings----{gnome-settings}
     |-gnote
     |-gvfs-afc-volume---{gvfs-afc-volum}
     |-gvfs-gdu-volume
     |-gvfs-gphoto2-vo
     |-gvfsd
     |-gvfsd-burn
     |-gvfsd-computer
     |-gvfsd-metadata
     |-gvfsd-trash
     |-hald-+-hald-runner-+-hald-addon-acpi
     |      |             `-hald-addon-inpu
     |      `-{hald}
     |-ibus-x11
     |-im-settings-dae-+-ibus-daemon-+-ibus-engine-pin
     |                 |             |-ibus-gconf
     |                 |             |-python
     |                 |             `-{ibus-daemon}
     |                 `-{im-settings-da}
     |-login---bash---su---bash
     |-master-+-pickup
     |        `-qmgr
     |-4*[mingetty]
     |-modem-manager
     |-notification-ar
     |-polkitd
     |-pulseaudio-+-gconf-helper
     |            `-2*[{pulseaudio}]
     |-rpc.statd
     |-rpcbind
     |-rsyslogd---3*[{rsyslogd}]
     |-rtkit-daemon---2*[{rtkit-daemon}]
     |-seahorse-daemon
     |-sshd---sshd---sshd---bash---bash---pstree
     |-trashapplet
     |-udevd---2*[udevd]
     |-udisks-daemon-+-udisks-daemon
     |               `-{udisks-daemon}
     |-wnck-applet
     `-wpa_supplicant
[hao@hao ~]$ bash
[hao@hao ~]$ pstree        
init-+-NetworkManager-+-dhclient
     |                `-{NetworkManager}
     |-abrtd
     |-acpid
     |-atd
     |-auditd---{auditd}
     |-automount---4*[{automount}]
     |-bonobo-activati---{bonobo-activat}
     |-certmonger
     |-clock-applet
     |-console-kit-dae---63*[{console-kit-da}]
     |-crond
     |-cupsd
     |-2*[dbus-daemon---{dbus-daemon}]
     |-2*[dbus-launch]
     |-devkit-power-da
     |-gconf-im-settin
     |-gconfd-2
     |-gdm-binary-+-gdm-simple-slav-+-Xorg
     |            |                 |-gdm-session-wor-+-gnome-session-+-abrt-applet
     |            |                 |                 |               |-bluetooth-apple
     |            |                 |                 |               |-evolution-alarm
     |            |                 |                 |               |-gdu-notificatio
     |            |                 |                 |               |-gnome-panel
     |            |                 |                 |               |-gnome-power-man
     |            |                 |                 |               |-gnome-volume-co
     |            |                 |                 |               |-gpk-update-icon
     |            |                 |                 |               |-metacity
     |            |                 |                 |               |-nautilus
     |            |                 |                 |               |-nm-applet
     |            |                 |                 |               |-polkit-gnome-au
     |            |                 |                 |               |-python
     |            |                 |                 |               |-restorecond
     |            |                 |                 |               `-{gnome-session}
     |            |                 |                 `-{gdm-session-wo}
     |            |                 `-{gdm-simple-sla}
     |            `-{gdm-binary}
     |-gdm-user-switch
     |-gnome-keyring-d---2*[{gnome-keyring-}]
     |-gnome-screensav
     |-gnome-settings----{gnome-settings}
     |-gnote
     |-gvfs-afc-volume---{gvfs-afc-volum}
     |-gvfs-gdu-volume
     |-gvfs-gphoto2-vo
     |-gvfsd
     |-gvfsd-burn
     |-gvfsd-computer
     |-gvfsd-metadata
     |-gvfsd-trash
     |-hald-+-hald-runner-+-hald-addon-acpi
     |      |             `-hald-addon-inpu
     |      `-{hald}
     |-ibus-x11
     |-im-settings-dae-+-ibus-daemon-+-ibus-engine-pin
     |                 |             |-ibus-gconf
     |                 |             |-python
     |                 |             `-{ibus-daemon}
     |                 `-{im-settings-da}
     |-login---bash---su---bash
     |-master-+-pickup
     |        `-qmgr
     |-4*[mingetty]
     |-modem-manager
     |-notification-ar
     |-polkitd
     |-pulseaudio-+-gconf-helper
     |            `-2*[{pulseaudio}]
     |-rpc.statd
     |-rpcbind
     |-rsyslogd---3*[{rsyslogd}]
     |-rtkit-daemon---2*[{rtkit-daemon}]
     |-seahorse-daemon
     |-sshd---sshd---sshd---bash---bash---bash---pstree
     |-trashapplet
     |-udevd---2*[udevd]
     |-udisks-daemon-+-udisks-daemon
     |               `-{udisks-daemon}
     |-wnck-applet
     `-wpa_supplicant

 

 

test

《鸟哥的Linux私房菜》学习笔记(2)——Bash特性,布布扣,bubuko.com

《鸟哥的Linux私房菜》学习笔记(2)——Bash特性

标签:style   blog   color   使用   io   strong   ar   cti   

原文地址:http://www.cnblogs.com/mingcaoyouxin/p/3895203.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!