The mode of running the program;
The Linux system divides itself into two parts, the core software, which is kernel, also known as kernel space, and the other part is a normal application, which is called user space.
Code in user space runs at a lower level of privilege, sees only some of the system resources that they are allowed to use, does not use certain system features, and does not have direct access to kernel space and hardware devices, as well as other specific usage restrictions.
User space: Space,us kernel space: System spaces
POS:P ortable Operating System Portable OS Specification
Posix
API; programming Interface
Run the program format;
Window;exe,dll (Dynamic library) dynamically linked library
Linux:elf, so (shared object)
Generally speaking, the program is divided into two parts
program; instruction + data
instruction, read-only
The instructions that can be run on the CPU, which are fixed on the CPU, cannot be changed or modified, are usually read-only
data, reading and writing
Data is the object of instruction processing, so it is usually read-write, readable and can be modified.
program, algorithm plus data structure, programmer write program is nothing more than call the CPU command some of the commands, the data it expects to process processing, the data is stored in memory.
A library call, a system call, a program that is allowed to be called
malloc (), Free ()
Programming languages, assembly language, microcode programming
Some specific hardware-related code, driver development in the system.
High-level language C C + + uses narrow faces
Primarily write system-level applications, drivers
Advanced application Java, Python php
Wide application area
Unix-like
Distribution of Linux;
Slackware
Secondary release SuSE
openSUSE
Debian:
Secondary release Ubuntu
Three-time release mint
Redhat: Red Hat
Rhel:redhat Enterprise Linux Business Edition every 18 months hairstyle a new version,
CentOS; The various versions released by Rhel are recompiled in a fully compatible RHEL format and are open for free on the internet
Fedora; release a new version of Personal Edition every 6 months
ArchLinux
Gentoo
Android; kernel (kernel) +busybox +java virtual machine for
Apache;apache
Bsd;bsd
Gnu;gplv2 version, GPLv3 version, pernicious influence Infinity concept
The GPL pernicious influence infinite agreement
LGPL (Lesser) loose
For example:
a:1000, GPL
b:20000, 20
A program wrote 1000 lines of code, followed the GPL agreement, and a B program, because a program is
Freely obtained, B program reference to a A, a, a program own 20000 lines of code, which it borrows
A of 20 lines, this is only a thousand points, but as long as a with a edge, B must put the remaining
Some code follows the GPL protocol
20000 lines of code only borrowed 20 lines and the remaining 19980 are open source.
Apache;apache
Bsd;bsd
The relationship between CentOS and Linux
CentOS is the operating system established by Basic Linux
Linux is a kernel system, only the terminal command interface, no graphical interface
CentOS also has a terminal command interface and graphical interface
Linux and CentOS are both open source systems
The relationship between CentOS and Rhel
Rhel releases are available in two ways, binary and source code. can be downloaded for free online, if you use an online upgrade including Patch Consulting services will be charged.
Rhel has always provided the source code for the distribution, and CentOS is the source of the Rhel release to recompile, to form a binary version that can be used. Since the source code for Linux is GNU, it is legal to get the source code from Ruel to the new binary. Knowledge Redhat is a trademark. So in the new release version of Redhat's trademark removed.
The GPL (general public License) is an unofficial Chinese translation of the GNU Common Authority. It is not a statutory release clause of the Free Software Foundation or the use of GNU General public Licensed software, which is only available in the English language of the gun general Public License.
Lgpl,gun Wide general Public License
The GNU,GNU program, also known as the slave program, was publicly launched by Richard Stallman in 27 in September 1983. Its goal is to create a set of completely free operating systems. GNU General Public License. That is, anti-copyright concepts
Apache, is the world's first Web server software to use. It can run on almost all widely used computer platforms and is one of the most popular Web server-side software due to its widespread use across platforms and security.
BSD (Berkeley software distribution, Berkeley Software suite) is a UNIX derivative system, and BSD today is not specifically a BSD derivative version, but a branch of Unix-like operating system.
Package Manager
RPM;RPM Package Manager, although the file format ranked Redhat logo, but its original design concept is open, now includes OpenLinux, Rhel,fedora,s,u,s,e, and Turbo Linux CentOS, and so on, can be regarded as a recognized industry standard
Dpt
Debian,ubuntu
Free software;
Free to use, free to learn and modify, free to distribute, free to create derivative versions,
The philosophical thought of Linux
1, all documents, almost all resources, including hardware equipment are the founder of the file format,
2, by a number of single-parent small program composition; A program only implements a function, and to do well, the combination of small programs to complete complex characters
3, try to avoid interacting with the user, the goal; Implement scripting to automate certain functions
4. Use plain text files to save configuration information; A text editor used to perform system configuration work
How to get the release of CentOS;
Http://mirrors.aliyun.com
Http://mirrors.souhu.com
Http://mirrors.163.com
The device that the user interacts with the host computer, which must be used;
Physical terminal; Direct access to the local display and keyboard devices;/dev/console (console)
Virtual terminal, a software-based terminal attached to a physical terminal, CentOS 6 launches 6 virtual terminals by default
CTRL+ALT+F1-F6 switching
The terminal of virtual reality, which is attached to the physical terminal, but provides the desktop environment, and the graphical terminal is also a kind of virtual terminal.
The path of the device file;/dev/tty# (0-... )
A command-line interface opened under the graphical interface. A remote-open interface based on SSH protocol or Telnet protocol
The path of the device file;/dev/pts/# (0 to infinity)
View your current terminal equipment commands; #tty
Interactive interface; After starting the terminal, attach an interactive application to the end device in two categories;
GUI; Image application Interface window Manager to manage
X protocol,window,manager,desktop x protocol
Desktop;
GNOME Desktop System (C language Development library GTK)
ked Desktop System (c + + development qt)
XFCE Embedded (lightweight desktop environment)
CLI: Text interface
Shell program: The shell itself means (shell, the shell of the entire system)
SH (Bourn)
CSH close to the C language style of csh, the difference is still very big
Upgraded version of Tcsh CSH
Ksh (Korn) commercial products powerful want to buy
Bash (Bourn again shell) follows the GPL protocol (set CSH, Ksh, a bit) the most popular open source sh
ZSH features Powerful
See what you like, the many versions default, or bash,
Displays the command #echo of the currently used SHELL $SHELL
Displays commands for all shells used by the current system, #cat/etc/shells
Command Prompt (prompt) only refers to the # number.
{ [email protected] ~}: $PS 1 environment variable to define the
echo $PS 1 [\[email protected]\h \w]\$ follow this format to use
In fact, there are two types of Linux users prompt
If you log in with an administrator, display: #
If you are using a normal user, display: $
Command
Input command, (ebter) Enter
Tells or draws the shell program to find the executable program or code corresponding to the typed command, which is parsed and submitted to the kernel to allocate resources to run it. To represent one or more processes; A running program is called (a process).
There are two types of commands that can be executed in the shell.
The built-in command, which is brought by the shell and provided by a command;
external command; The executable program file is available under a file system path of the current system
Which,whereis, external command to see where the file is
The use of the format is which or Whereis followed by the name of the command.
Differentiate internal or external commands:
#type (command) command, for example, #type CD
Attention! Strictly case-sensitive
Run command: Type the command at the command prompt, and the command type format is usually as follows;
COMMAND [OPTIONS ...] [ARGUMENTS ...]
Command option Parameters
The leftmost must be a command, otherwise the error
The right side of the following can be an option, options can have more than one, plus the brackets mean that some commands are not used, this option is optional,
And then there is the parameter.
option to enable or disable some or all of the functions of a command;
short option;-C For example:-l-h
Short options generally include a horizontal line with a single character
In most cases, multiple short options can be used as commands, such as-l,h, which can be written-LH; can be merged, not merged using the middle must be separated by white space characters
A long option;--word, for example;--long--human-readable
Long options generally cannot be combined
The long option is usually guided by two horizontal lines.
The object of the command, which takes effect, for example, Ls/etc and Ls/var
The argument is to provide data to the command; Data is not a number. strings are actually data
Parameters can sometimes be multiple, and multiple parameters also need to be separated by white space characters
Again, the command itself must be unloaded to the left, and the command itself is an executable binary, or a built-in command from the shell.
Note
1, multiple options, as well as between the multi-parameter and the command should be separated by white space characters, white space characters can be a blank, or it can be two blank;
2. Cancel command execution; CTRL + C
File system;
C:\Program Files\office11\word\word.exe Actually, this is a path.
/etc/sysconfig/network-scripts/ifcfg-eth0 file path
The end of the catalogue is called a file (eth0)
For Linux all the starting range is called the root, which is the absolute top-level range, because all files on Linux can be accessed and must start from this location, called the filesystem.
The directory is just a path mapping method.
The file has two types of data, and the file access process is a path
Meta data; metadata
data;
File systems for Linux
1, the file name strictly distinguishes the character case; For example, File1,file1,file1 is a different file;
2, the file name can use any character except/unexpected, do not recommend the use of special characters;
The (/) character has two meanings, the first (/) it is the root directory, and the second (/it is the path delimiter)
3. The maximum length of the file name cannot exceed 255 characters;
4, all. The beginning of the file, are hidden files;
There are two types of paths;
1, absolute path, from the top of the beginning, from the root directory starting from the path;
2, relative path; the path to the beginning of the current position;
For example, the C-disk ABC folder has a 1 file, there is a Def folder, and Def file has a 2 file.
The 1 and 2 file paths are: (both absolute paths)
C:\ABC\1
C:\ABC\DEF\2
If you let the 1 file represent the path to the 2 file
Absolute path: C:\ABC\DEF\2
Relative path: def\2 (because the path of the C:\ABC in front of the 1 and 2 files does not have to be written out)
C:/website/img/photo.jpg We know that the Photo.jpg file is in the IMG subdirectory of the website directory in the C drive. The path to this complete description file location is the absolute path. We do not need to know any other information to determine the location of the file based on the absolute path.
The relative path is relative to the target position. Wherever these files are placed, they will not go wrong as long as their relative relationships have not changed.
.. : Represents the top level directory of the current directory
Current directory, also known as working directory;
Pwd:printing working Directory
If you can, you must not write it all.
Lsb:linux Standard Base Library
These paths are defined in terms of LSB.
Command termination:
LS: Displays the target list, which is a highly efficient command in Linux. The output information of the LS command can be colored and highlighted to partition different types of files.
CD: Switch working directory to dirname. Where dirname notation can be either an absolute path or a relative path. If the directory name is omitted, it is transformed to the user's home directory (that is, the directory that was just login). In addition, the meaning of home directory is also indicated,
The. Is the directory that is currently located,
Type: Displays the types of the specified command, judging whether the given instruction is an internal or external instruction
TTY: Print the file name of the terminal device connected to the standard input
Cat: Connect files and print to standard output devices, which cat often uses to display the contents of a file, similar to the type command
Which: Used to find and display the given absolute path, the environment variable path has a convenient directory where the Find command is saved. The which directive looks for eligible files in the directory where the environment variable $path is set. That is, using the which command, you can see whether a system command is a village head, and which command to perform exactly which location.
Whereis: The path of the We prohibit program, source code file, and Man manual page of the location directive.
PWD: Displays the user's current working directory as an absolute path. The command writes the full path name of the current directory (from the root directory) to the flag output. All directories are used/delimited. The first/represents the root directory, and the last directory is the current directory. The PWD command immediately learns the absolute path name of the working directory in which it is currently located.
Echo: Used to print the value of a shell variable in the shell, or to output the specified string directly. The echo command of Linux, which is very common in shell programming, is often used when printing variable value under the terminal, so it is necessary to understand the use of the echo command function is to display a paragraph of text on the display, generally play a hint of the role.
Command:
1, file system-related;
Directory Management
File Management
File View
File editing
2, System management related;
Access to Linux command help
external command; In fact, all external commands have an executable program located in a directory of the file system; using Which,whereis to get
The path of the shell program search executable program file is defined in the PATH environment variable;
#echo $PATH attention! From left to right, it's important, it's in order.
It's the first time it's been found, and if a command has execute program files under multiple paths, the order is critical, and that's the concept of the search path.
Format, COMMAND [OPTIONS ...] [ARGUMENTS ...]
Command option Parameters
Internal commands get help; The shell program comes with some basic management tools that come directly with you
#help COMMAND for example; Help CD
External command to get help; commands with separate external executable program files
1, # COMMAND--help #COMMAND-H
2. User manual (Manual) #man COMMAND
3. Information page #info COMMAND
4, the program's own Help document README INSTALL Changelog
5, the official documents of the program, the official site; documentation
6, the official documents of the release version
7. Google
Built-in command help;
#help COMMAND
Hash command:
The path result of the external command that the shell has searched for is cached into the KV (key-value) store;
History command; Manage command histories
In fact, the command history of Linux, after logging into the system, all the new commands are executed. will be placed in the buffer of memory, but once this login is introduced, these commands are recorded in the history file and the command history is numbered.
There are two places in the order history;
When you log in to the shell, the commands that are recorded in the command history file are read; cat.bash_history this historical file is in the user's home directory
The new command intelligence is recorded in the cache after logging into the shell, and these commands are "appended to the command history file" when the user exits.
History
-A; Append the new command history list for this session to the history file;
-D; Delete the command specified in the history;
-C; empty command history;
8
Quick operation; 1
! #; Can call the history of the # command; 6
! string; invokes the most recent command in history that starts with a string; 1 from bottom to top 5
!!; the previous order; 8
External commands help to obtain;
Each programmer usually develops major work in two parts, 1, write programs, 2, write programs help
Mans COMMAND
manual page; ls/usr/share/man1 CD. /man2
Man1...man8 called the first chapter
man1; user command man ls
man2; system call
MAN3;C Library Call
Man4; equipment files and special documents
MAN5; configuration file format
Man6; game-related
Man7; miscellaneous
man8; the command for the management class formats the disk partition as a management-tired command
Note: Some keywords exist in more than one section of the Help manual;
To view the manuals in the specified chapters; Man # command
The configuration file for the man command;/etc/man.config
Manpath/path/to/somewhere: Indicates the new manual file search location
#man-M/path/to/somewhere COMMAND: to the specified position
Search for the command name of the hand album and display it:
Paragraph descriptions in the Help manual
NAME
Synopsis
DESCRIPTION
OPTIONS
EXAMPLES
AUTHOR
REPORTING BUGS
See ALSO
Man less
The meaning of these symbols in synopsis;
{}; optional content
<>: Required Content
A|b: Two selected to
... : The same content can appear multiple times
The manipulation of the man command
SPACEBAR (space), ^,^f,^f,: Flip the screen to the end of the file ^ (Ctrl)
B,^B: Flip the screen to the file header
D,^d: Turn half screen at the end of the file
U,^u: Turn half screen to file header
Return:^n e ^e or ^j: Flip a line to the end of a file
Y or ^y or ^p or K or ^k: Flip a line to the file header
Q: Launch
#: Jump To Line #;
1 g: Back to File header
G: Turn to file header
Basic knowledge of the computer 2