Linux bash shell basis of introduction and basic characteristics

Today continue to speak the basics of Linux, the content is about the bash shell. Share knowledge of the bash shell, for example basic characteristics.

 1.8) bash shell Introduction

1.8.1) What is the bash shell
  Broadly speaking is bash shell is a command interpreter to interact with the kernel.
  It is a bash shell command interpreter, which in the outermost layer of the operating system, the user program and the kernel is responsible for interactive operation, an interface to translate commands input by the user to the operating system, and outputs the processed result to the screen.
  When we use the remote connection tool to connect linux service, the system will open a default shell, we can execute this command in the interface, such as: obtaining the current time, create a user and so on.

Role 1.8.2) bash shell is
  to use the shell to achieve most of the management of Linux systems, such as: file management, user management, rights management, disk management, network management, software management, application management ......

1.8.3) two kinds bash use
  1) command
    inefficient for a small amount of work
  2) script
    with high efficiency, suitable for mass work

1.8.4) command prompt
  [root @ centos7 ~] #

  root: on behalf of the user currently logged on;

  @: Representative delimiter;

  centos7: represents the host name;

  ~: Represents the current directory location
  where #: super administrator, $: ordinary users


Then he told a Linux command.
echo command, its role is everything after the acquisition command, WYSIWYG.

echo: WYSIWYG. You echo back the contents of the output parameters
-e: identifying line breaks and other special symbols
\: Escape
$: Call Variables

 

Example 1: Print out and oldboy oldgirl above two characters printed to the screen, and to display two lines.

 

 

 

Example 2: Please print out "hello world" to the screen above.

 

 

 

Example 3: Please call the variable age

 

 

 

Whoami command is another command, view the user is currently logged on.

 

1.8.5) of the basic grammar shell
command options parameter
command [-options] [arguments] brackets dispensable

 


Characteristics 1.8.6) shell of

1.8.6.1) is a major characteristic of shell completion . There are three ways completion:

1, command completion the Tab
2, parameter completion: yum -y install bash-Completion
3, option Complement: mainly the completion path
when using windows to find a particularly large number of files in a directory hierarchy, open the efficiency will be very slow but if you use linux to find a particularly large number of files in a directory hierarchy, you can quickly completion by the tab key.
PS: tab key to real command completion, the path completion, tab fill in the actual production of our whole tend to be the most used, because it can reduce the error rate path and execute commands, but also improve the efficiency of input.


Another feature 1.8.6.2) shell is commonly used Linux command line shortcuts , rational use of shortcut keys, can improve the efficiency of input.
Ctrl + a: the cursor jumps to the beginning
Ctrl + e: the cursor jumps to the end of the row
Ctrl + w: a space units, the content of the current cursor position before deleting
Ctrl + u: the current cursor position before the content of all delete
Ctrl + l: clear screen
Ctrl + c: terminate the current command
Ctrl + d: exit to disconnect from the current connection (exit, Zimbabwe Logout)
Ctrl + z: hang, put the background
Ctrl + r: search command history
Ctrl + s: lock screen
Ctrl + q: unlock
Ctrl + left and right: according to the word jump cursor
ESC +:. instantaneously displayed on a command, the final content, separated by a space

#: Note, do not perform

 

Guess you like

Origin www.cnblogs.com/dabai-wang09/p/11025285.html
Recommended