SHELL 基本概論

Embed Size (px)

DESCRIPTION

SHELL 基本概論. 前言 簡介 各種功能 特殊字元 環境變數與設定. 常見的 Shell. Bourne Shell Job Shell Bash Shell C Shell. Bash Shell 使用. 解益並執行指令 簡化使用者操作 程式化的作用. Bash Shell 設定檔. /etc/profile :第一個被執行的組態檔 /etc/profile.d :軟體所配置的環境設定 /etc/bashrc : Bash Shell 提示符號顯示資訊 ~/.bashrc :使用者自訂相關變數 - PowerPoint PPT Presentation

Citation preview

  • SHELL

  • ShellBourne ShellJob ShellBash ShellC Shell

  • Bash Shell

  • Bash Shell/etc/profile/etc/profile.d/etc/bashrcBash Shell ~/.bashrc~/.bash_profile

  • Bash Shell/etc/bashrc

  • typeechoenvsetaliashistorycutgrep

  • 1 Shell Shell , , , shell , , , shell ,

  • Shell

  • Shell shell, MS DOS shell command.comWindows shell explorer.exeUnix , shell shell Small Bourne Shell (ash)Bourne Again Shell (bash/bash2)Bourne Shell (bsh)BSD C Shell (csh)Korn Shell (ksh)Enhanced C Shell (tcsh) ZShell (zsh)

  • ShellBourne Shell shell, Unix BSD C Shell Berkeley , Enhanced C Shell , Bourne Again Shell Bourne Shell, BSD C Shell , (alias) (history)

  • Shell shell , shell , Linux shell bash, ash kshtcsh zsh

  • Shell Unix shell , BSD csh, Linux bash shell shell , shell

  • Shell , $%# > cassia

  • shell , (, )ksh$ bash bash2[cassia@free ~]$zsh[cassia@free]~ % tcsh[cassia@free ~]$, ,

  • Shell shell # cat /etc/shells

  • Shell shell, echo , SHELL

  • Shell , finger , shell

  • Shell shell , shell shell shell, exit

  • Shell

  • Shell, , shell, ( cassia )

  • Shellchsh ,

    , shell

  • FTP E-mail , telnet ssh shell /sbin/nologin , ( cas sia ) telnet root /etc/passwd

  • 2 Shell shell , Linux bash, bash

  • , [][][][][Backspace]

  • , , .bash_history ,

  • history , ,

  • , ""

  • ! !-0 ,

  • , mycopy , cp mycopy cp alias , , Linux

  • , alias ,

  • , , unalias

    , , , alias .bashrc

  • .bashrc , alias , .bashrc , /etc/profile.d *.sh

  • , .bashrc , /etc/profile.d *.sh , .bashrc ,

  • ,

  • , bash , , [Tab] , bash ,

  • , ,

  • , bgfgjobs

  • , , root ,

  • ,

  • 3 Shell Shell , #, tac /etc/bashrc

  • 3 Shell &updatedb & , ', shell mycopy='cp -v' , mycopy cp -v * ls a* , "a"

  • 3 Shell ? ls b? , 2 , 1 "b", 2 . ./exefile , exefile (exefile ).. cd ..

  • 3 Shell ;,

    >,

  • 3 Shell >>

    \ (escape), |, ~,

  • 3 Shell []

  • 3 Shell [!], ls [!abc]* , "a" "b""c" {}: [] , , ls {a,b,c}*

  • . * /tmp , ls .*, .* shell . .. ls .. , cp -R /root/.* /tmp/ , /root , cp -R /root/../* /tmp/, , . *

  • 4 Shell Shell , (Environment Variables) shell ,

  • shell , bash set (tcsh setenv )

  • Bourne Shell ,

  • export

  • , , , , .bashrc

  • .bashrc , , root /etc bashrc profile , /etc/profile.d .sh

  • , , ,

  • PATH , PATH ,

  • PATH

    , , , .bashrc ,

  • bash [Tab] [Tab] [Tab] [Ctrl]+c [Ctrl]+d [Shift]-[Pageup]/[Shift]-[Pagedown]/

  • bash == \ ` command`$(command) export export PATHunset