One: Shell concept
The word shell is unfamiliar, meaning "shell" is a layer of interaction between the OS core and the user, in a Linux system, the user can use the command terminal, the shell command down to convey their wishes,
Drive kernel to mobilize the hardware to achieve their own purpose!
Pictures of Bird's-cousin's private cuisine:
The popular understanding is a collection of text commands that can be more intuitive and effective in manipulating kernel to achieve our goal, in which shell script is a common scripting language in many project practices!
II: Shell Management
There are many kinds of shells, there is a management for Linux system, those kinds of shell is legal, can be recognized execution, defined in /etc/shells :
[Email protected]:~$ cat/etc/shells #/etc/shells:valid Login Shells/bin/sh/bin/dash/bin/bash/bin/rbash
Can see my Ubuntu 13.04 valid shell types on these four kinds. Where sh stands for Bourne Shell and now has an enhanced version of Bourne Again Shell, which is bash,
The current Linux preset shell type!
For the type of shell that the current user is using, it can be found in /etc/passwd :
Jscese:x:1000:1000:jscese,,,:/home/jscese:/bin/bash
Three: Bash features
1.History-Save the command before the last logoff system, saved in the ~/.bash_history file
2.Tab completion , prompting
3.Alias,unalias--Command encapsulation and removal, alias ll = ' Ls-al ' represents the use of ll instead of Ls-al, with simple characters to represent complex instructions, easy to use! Unalias ll remove this command from LL.
4.echo-Output variable echo $PATH, addpath= $PATH: ADD unset addpath, $-pid,?-Callback value
5. The deletion of the variable is replaced by the ${path expression} rule (which comes): ${path ##/*/} Delete the longest content between two slashes from the beginning of the variable PATH
6. set the variables as follows:
7./dev/null--Garbage bin black hole device
8. logical instruction , when combined with multiple logic, the return value is transitive to the right:
9. Pipeline Command (pipe)
Cut a section, grep gets the line that meets the requirements, sort sorts, uniq repeats only one, and the WC shows how many lines of the file. Word, tee bidirectional re-conduction both output and can be saved
Character conversion commands: TR, col, join, Paste, expand