Shell Shell (shell of operating system)
Introduction:Shell isSystemuser interface that provides the user with aKernelan interface for interacting. It receives the command entered by the user and feeds it intoKernelto execute. Actually, the shell is a command .Interpreter,it interprets the commands entered by the user and sends them toKernel. In addition, the shell has its own programming language for editing commands, which allows the user to write programs composed of Shell commands.
Operating principle: Distribute child process runs during Operation .
equivalent to a medium that executes the command issued by the terminal. the shell captures the user commands to the operating system, handing the operating system results to the user, andthe shell acting as an operating system protector.
Bash: The specific media, the specific shell, is the GNU Bourne Again Shell, which is the default shell on the GNU operating system.
One, the common environment variables:
1,path: Specifies the search path for the command (bash searches in path)
./ Current Path
echo $PATH fetch current Path
/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/luodan/bin
separate the two: bash to search. After it is found, it is loaded into memory, followed by operation, and finally output
2.export set a new environment variable export hello= "HELLO" (can be without quotation marks), you can add the path of the code of the program you write to the path, you can execute the program in other directories.
[Email protected] 05_06]$ export PATH= $PATH:/home/luodan/05_06
[Email protected] 05_06]$ Test.exe
3.ENV Show All environment variables
4.set show locally defined shell variables
5.unset Clear environment variable unset Hello 6.readonly set read-only environment variable readonly Hello
6.HISTSIZE: Refers to the number of records saved by the history command.
7.LOGNAME: Refers to the login name of the current user.
[Email protected]]$ Echo $LOGNAME
Luodan
8.HOSTNAME: Refers to the name of the host, many applications to use the host name 7, usually from the environment variable to obtain.
[Email protected]]$ Echo $HOSTNAME
Localhost.localdomain
6.SHELL: What kind of SHELL is used by the current user.
[[email protected] home]$ echo $SHELL display the current media
/bin/bash
7.lang/languge: and language-related environment variables, users in multiple languages can modify this environment variable.
[Email protected] home]$ echo $LANG/languge
en_US. Utf-8/languge
Two, the user
PS1; command basic prompt, for root user is #, for normal user is $
[Email protected] home]$ echo $PS 1
[\[email protected]\h \w]\$
PS2: Secondary prompt
[[email protected] home]$ echo $PS 2(ls ') prompts for a command that is not finished.
>
Su is used to switch accounts
[email protected] home]$ su
Password:
su user name (Luodan) to switch to normal user
[email protected] luodan]# su Luodan
[Email protected] ~]$
Whoami: Show Current User
Three, Linuxe file type: the
1, normal file [-], plain text, binary
2, catalogue [d]
3, Connection file [l]
Soft Connect , hard connect (inode)
4, equipment and equipment files ( All files ) block device files that are some storage files, hard disk ,[b] character device files that are some serial port interface files, such as printer, hard disk, mouse [C]
5, Socket [s]
6. piping [p]
There is no extension, and the suffix is used to denote the user to distinguish
Mnt hangs in temporary partition
Proc: Show process information CPU memory old version
Sys: with proc
Dev: Device
Lib: library file
This article is from the "11440755" blog, please be sure to keep this source http://luodn.blog.51cto.com/11440755/1785311
Basic instructions for Linuxe