shell basic concepts of the shell

First, the script introduces

1 , the script simply is a section of text commands (accumulation of some instructions) , command these words are visible (such as Notepad to open can view, edit).

Common Script: JavaScript ( JS , front-end), VBScript , ASP , JSP , PHP (backend), SQL (database manipulation language), Perl , Shell , Python , Ruby , JavaFX , Lua and so on.

2 , why should learn and use shell ?

Shell belongs to the built-in scripting

Program development efficiency is very high, depending on the powerful command can be rapidly completed development tasks (batch)

The syntax is simple, relatively easy to write code, easy to learn

Two, shell Introduction

Shell is a C language prepared scripting language, it is the user and Linux bridge, a user input command to the Shell process, Shell the corresponding operation to the kernel ( Kernel ), the kernel outputs the result of the processing to the user.

Shell Since it is a work in Linux on the kernel, then we also need to understand under Linux knowledge. Linux is a free trial and free dissemination of class Unix operating system, is based on POSIX and UNIX multi-user, multitasking service, support multi-threading and multi- CPU operating system.

1983 Nian 9 Yue 27 Ri, Richard Stallman (Richard - Matthew - Stallman) initiated GNU program, its goal is to create a set of completely free operating system. To ensure that GNU software is free to use, copy, modify and distribute all of the GNU software to have a all rights granted to the terms of any person's agreement in the case to prevent others from adding any restrictions, GNU General Public License license ( GNU General License Plubic , the GPL ), it plainly is not for commercial purposes.

GNU is the "GNU is Not Unix" recursive acronym. UNIX is the name of a commercial operating system, widely used.

1985 Nian, Richard Stallman founded the Free Software Foundation ( as Free Software Foundation , the FSF ) to serve GNU provide technical, legal and financial support programs.

1990 Nian, GNU plans to develop major projects Emacs (text editor), GCC ( GNU Compiler Collection , GNU compile translation device collection), Bash , etc., GCC is a GNU developed programming language compiler. As well as develop some UNIX system libraries and tools.

1991 Nian, Linuxs Torvalds (Linus - Torvalds) developed the UNIX -compatible Linux operating system kernel and GPL released under the terms.

1992 Nian, Linux and other GUN combination of software, completely free GUN / Linux operating system was born, referred to as Linux .

1995 Nian 1 Yue, Bob Young founded the ACC company to GNU / Linux as the core, has developed a RedHat Linux Business Edition.

Linux basic idea of two things: first, everything is a file; second, every software has identified uses.

And Unix ideas very similar. Kernel Shell command the user to parse the command and passed to the kernel to perform an action

Three, shell classification

1 , the graphical interface shell ( the GUI shell )

GUI for the Unix or class Unix operating system to construct a fully functional, easy to operate and user-friendly desktop environment. Mainstream desktop environment KDE , Gnome and so on.

2 , a command line interface, the shell ( the CLI the shell )

CLI is type executable instructions prompt the user interface, a user input command through the keyboard, a series of operations is completed. In the Linux mainstream on the system CLI implementation is Bash , many Linux distributions default Shell . There are many Unix on Shell , for example, tcsh , csh , Ash , BSH , ksh , etc.

Fourth, view the shell

Shell is a program, usually placed in / bin or / user / bin directory, the current Linux system available Shell are recorded in the / etc / shells file. / etc / shells is a plain text file, you can open it in a graphical interface, you can also use the cat command to view it.

By cat to view the current command Linux system available Shell :

[root@ren4 ~]# cat /etc/shells

/bin/sh

/bin/bash

/usr/bin/sh

/usr/bin/bash

In modern Linux on, SH is already bash in place, / bin / SH often point to / bin / bash symbolic link. If you want to view the current Linux default Shell , you can output SHELL environment variable:

[root@ren4 ~]# echo $SHELL

/bin/bash

The results show that the output of the default Shell is bash .

SHELL is the Linux system environment variable, which indicates the current use of Shell location in the program, which is used by Shell .

Guess you like

Origin www.cnblogs.com/renyz/p/11297248.html