Shell Introduction
Shell is a Linux interactive media with users the CentOS default shell is bash
Command History 2
User home directory file record command history
Ls/root/.bash_history
History view commands Historical maximum can view 1000 article
environment variable Settings 1000
History-c empty the commands in memory
Empty command
The command will be written to the file only when you exit the terminal
Sets the number of command history/etc/profile
Modify the command history value
Make the variable effective source/etc/profile
Add a command to use time to set the variable format
Make the variable effective modify the configuration file/etc/profile
Source/etc/profile
Permanently save command file add a permission
!! Executes the previous command
! n Number of commands to execute
! Character performs the most recent command that begins with a character
Features of the command
The TAB key lists all commands that begin with a character by pressing the two
The TAB key automatically complements the command parameters
I need that completion bag.
Effective requires restart
Aliases Alias
Define the profile for the alias
defined in scripts under. BASHRC and PROFILE.D
Cancel Alias Unalias
Wildcard characters
, output orientation
Pass Match
Files ending in *.txt
No characters and several
Ls?. Txt? Represents an arbitrary character
LS [0-3].txt the characters inside the square brackets take only one
Scope of support
ls {1,2,3}.txt curly brace
Output Punch
Cat 1.txt>2.txt Remove the original content rewrite
Cat 1.txt>>2.txt will not delete the original content will append to the file after
2> Error Redirection
2>> Error Append redirect
&> Hybrid Redirection
Support for Append content
Categorical redirection separate error messages and correct information
Less than sign <
Enter the file on the right to a command.
Shell Fundamentals 1