1th Basic knowledge of Unix

Source: Internet
Author: User

1.1 Introduction

All operating systems serve programs: Execute new programs, open files, read files, allocate storage, and get the current time

1.2 UNIX Architecture

The interface of the kernel is called a system call

Public Function Library building up the system call Interface , the application can use both common library functions and system invoke interfaces, and the shell is a special application that provides an interface for other applications

1.3 Shell

The shell is a command-line interpreter, and the shell's user input is usually from the terminal, sometimes from a file (as a shell script)

1.4 Files and directories

The stat and FSTAT functions return information structures that contain all file attributes

Get directory information: Opendir, Readir, Closedir

1.5 Inputs and outputs

File description is usually a small non-negative integer: standard input, standard output, standard error

Redirect:./a.out <infile >outfile

1.6 Procedures and processes

Program is an executable program that stores the directory files on the disk

Process Control main right three main functions: fork, exec, waitpid

All threads in a process share a space, file descriptors, stacks, and process-related properties

1.7 Error Handling

1.8 User Logo

Users with a user ID of 0 are super users

Getuid (), Getgid ();

1.9 Signal

Signal (signal) is used to notify the process of what happened

1.10 Time Value

1.11 system calls and library functions

System calls are interfaces provided by the kernel, and library functions can understand further encapsulation

Exercises:

1.4: The calendar is stored in the number of 32 digits (2^31-1=214 768 347)/(3600*24*365) =68 so 1970+68=2038




Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

1th Basic knowledge of Unix

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.