operating system
THE:
Operating System, general-purpose software program
Hard drive
Process Management
Memory Management
Network management
Security Management
Document Management
OS Category:
Server OS: RHEL, CentOS, Windows Server, AIX
Desktop OS: Windows 10, Mac OS, Fedora
The mobile device OS: Andriod, IOS, YunOS
Development interface standard
ABI: Application Binary Interface
ABI describes the low-level interface between the application and the OS, allows compiled object code compatible ABI systems can be run without change
API:Application Programming Interface
API defines an interface between the source code and libraries, so the same source code can be compiled in any system that supports the API
POSIX:Portable Operating System Interface
A series of IEEE standard API defined in the operating system
POSIX-compliant program can be executed in other POSIX operating system compiler
Run the program format :
Windows: EXE, .dll, .lib
Linux:ELF,.so(shared object), .a
Context switching:
Context:
Before each task runs, the task from the CPU needs to know where to load, and from where to start running, which involves the CPU registers and program counter (PC).
CPU CPU registers are built in a small capacity but fast memory
Location of the program counter instruction is stored CPU is doing, or about to be executed command position
These two tasks before running any CPU must rely on the environment, called the CPU context
Context switching step:
1. The context before a CPU (i.e., CPU registers and the contents of the program counter inside) saved;
2. The context is then loaded into the new task registers and program counter;
3. Finally jump to a new position within the meaning of the program counter, run a new task
When the context is saved will be stored in the system kernel, wait for the task to re-schedule the execution came loaded again
CPU context switching three categories: process context switch, a thread context switch, context switching terminal
Linux related presentations
(1) linux is an open source, free operating system, its stability, safety, handling multiple concurrent (POSIX and UNIX-based multi-user, multi-tasking support multi-threading and multi-CPU)
operating system.
linux is a Unix-like operating system, completely open source, multi-user multi-tasking, servers (database server, Web server, application server, log server, server images and other
embedded fields, etc.) (such as routers, Linux needs to start), The mobile terminal (such as mobile phones Andrews, tablet)
(2) Common distributions: RedHat, CentOS, Ubuntu, SUSE, FreeBSD, etc.
(3) linux applications: Usually the server using the
LAMP (Linux + the Apache + MySQL + PHP)
LNMP (Linux + Nginx + MySQL + PHP)
(4) linux features:
- Free / Open Source
- Support for multi-threaded / multi-user / multi-tasking / multi-CPU (and more complicated)
- security is good (open source if there is a loophole there to repair the network industry Lei Feng)
- excellent memory and file management
-Linux minimum only 4m-> embedded development (cell phone users more than what a huge market)
Linux philosophy
Everything is a file
Small, single-purpose program
Linker together to accomplish complex tasks
Avoid confusing user interface
Configuration data is stored in the text
Obtaining Linux
https://wiki.centos.org/Download
http://mirrors.aliyun.com
http://mirrors.163.com
http://mirrors.sohu.com
virtual machine
Vmware: hardware, software simulation
Bash
sh (full name of the Bourne Shell): shell UNIX was originally used, and can be used on every UNIX.
bash (full name of the Bourne Again Shell): LinuxOS default, it is an extension of the Bourne Shell.
Simple Commands
- du -sh * # to view the current folder size
- du -sh * | sort -n statistics of the current folder (directory) size, press the file size sorting
- # Included:
- du -sk filename to view the specified file size
- cpu View
1) cpu number: #cat / proc / cpuinfo | grep "PHYSICAL the above mentioned id" | uniq | WC the -l
2) cpu Audit: #cat / proc / cpuinfo | grep "cpu Cores" | uniq
3) cpu type : #cat / proc / cpuinfo | grep 'model name' | uniq
memory View: #cat / proc / meminfo | grep MemTotal
hard to see: #fdisk the -l | grep Disk
uname -a # View kernel / operating system / CPU information linux system information
head -nl / etc / issue # check the OS version
cat / proc / cpuinfo # View CPU information
hostname # View the computer name linux system information command
lspci -tv # list all PCI devices
lsusb -tv # list all linux system USB device information command
lsmod # listed kernel module loaded
env # viewing environment variable resources
free -m # to view memory usage and the amount of swap
df -h # see how each partition usage
du -sh # View the specified directory the size of
grep MemTotal / proc / meminfo # view the amount of memory
grep MemFree / proc / meminfo # view the amount of free memory
uptime # View system uptime, number of users, load
cat / proc / loadavg # View system load disk and partition
mount | column -t # View articulated partition status
fdisk -l # View all partition
swapon -s # View all swap partitions
hdparm -i / dev / hda # View disk parameters (only for IDE devices)
dmesg | grep IDE # view when you start the IDE devices detect network status
ifconfig # View all the properties of the network interface
iptables -L # View firewall settings
route -n # View the routing table
netstat -lntp # View all listening ports
netstat -antp # view all established connections
netstat -s # View network statistics information processes
ps -ef # view all processes
top # display real-time process status of the user
w # view active user
id # specify the user to view information
last # view the user login log
cut -d: -f1 / etc / passwd # View all users of the system
cut -d: -f1 / etc / group # View all system groups
crontab -l # to view the current user's scheduled tasks service
chkconfig -list # lists all system services
chkconfig -list | grep on # lists all system services startup
rpm -qa # view all installed packages
cat / proc / cpuinfo: see linux system CPU-related parameters command
cat / proc / partitions: see linux hard disk and partition system information command information
cat / proc / meminfo: Check linux linux system memory information system command
cat / proc / version: Check version, similar to the -r uname
CAT / proc / ioports: View equipment io port
cat / proc / interrupts: View interrupts
cat / proc / pci: pci device View information
cat / proc / swaps: View information for all swap partitions
Help usage
man command keys, you can use shortcut keys to quickly and efficiently read the help documentation.