YiHsin Chang
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- tags: Linux --- # Introduction **操作系统的作用**:有效管理资源的分配 > 若无操作系统,则资源无法有效分配,最终导致资源竞争 **操作系统的地位**:操作系统向下封装硬件(管理硬件)、向上提供操作接口(提供系统调用函数) **系统编程**:在某个系统上编程 **系统调用**:调用操作系统提供的特殊接口(进程、线程) Linux操作系统的诞生、发展、成长过程依赖五个重要支柱:**Unix操作系统**、**Minix操作系统**、**GNU计划**、**POSIX标准**、**互联网** > GNU计划:开发了众多软件(如gcc, emacs),为Linux提供生态 > POSIX标准:一套用于Unix的接口标准,提高代码的可移植性 > **内核版本**:内核是系统的心脏,是运行程序、管理硬件的核心程序 > **发行版本**:将内核、源代码、相关的应用程序组成一个完整的操作系统 # 文件系统 Windows有分盘符(C盘、D盘),但是Linux只有分目录(根目录、家目录) 目录:路径的集合 路径的注意事项 > Linux:以「/」分割路径 > Windows:以「\」分割路径 任何文件夹都会有「.」、「..」这两个文件夹(需用ls -a才可显示出来,可用cd .来验证「.」为文件夹) > 「.」:代表当前目录 > 「..」:代表上级目录 FHS:规定了Linux根目录各文件夹的名称及作用,统一了Linux界命名混乱的标准 > **/**:根目录 > **/bin、/usr/bin**:bin目录,放工具 >> ![](https://i.imgur.com/SYHqCqE.png) > >**/home**:home目录,放用户,用户本身的目录叫做家目录 >**/lib**:放库函数、库文件(静态库、动态库) >**/usr/include**:放头文件 Linux一切皆文件,把所有东西都抽象为文件 > 普通文件(以-开头):文档、视频 >> ![](https://i.imgur.com/OZ4yhsH.png) > > 目录文件(以d开头):文件夹 >> ![](https://i.imgur.com/e27Caqx.png) > > 设备文件:把所有硬件抽象成文件 >> 字符设备文件(以c开头) >> ![](https://i.imgur.com/fpkDo9z.png) >> 块设备文件(以b开头) >> ![](https://i.imgur.com/2oz92yp.png) > > 链接文件(以l开头):快捷方式 >> ![](https://i.imgur.com/pYokK30.png) > > 管道文件:这类文件多用于进程间的通信 文件权限 三个为一组,分别为文件所有者、用户组、其他用户 > ![](https://i.imgur.com/eaWQM5x.png) > >![](https://i.imgur.com/dLstg9r.png) > > -:没权限 > r:可读 > w:可写 > x:可执行 > > 文件夹权限 > 没有x:无法进入文件夹 > 没有r:无法读取文件夹里有啥东西 > 没有w: 无法新增或删除文件 > Linux在创建一个用户时,会默认创建一个与用户同名的用户组 > 每个组有自己的id > 一个用户可以进入多个用户组 > **用户组信息文件:/etc/group** > **用户信息文件:/ect/passwd** > > ![](https://i.imgur.com/YbbvHwT.png) > 用户组的组号为0 > ![](https://i.imgur.com/VFYL8SL.png) > 用户(jimmyuniverse)的所属组号是1000,不是0,所以不属于用户组root,对stdio.h来说是其他用户 在Linux,以「.」为开头的文件是隐藏文件 **字符界面、图形界面 切换** ```c= // 在大多数Linux下 Ctrl + Alt + F2:切换到字符界面(F3, F4, F5, F6也行) Ctrl + Alt + F1:切换到图形界面(有的是F7) // 在Redhat下 命令 init 3:切换到字符界面 命令 init 5:切换到图形界面 ``` Linux的可执行程序通常是没有后缀的 Windows的64位兼容32位 Linux的64位不兼容32位 Linux的编码默认采用UTF-8(Unicode的一种)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully