Aaron Wu
    • 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
    • Engagement control
    • 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 Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control 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
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    --- title: 常用linux指令 | 建北電資網管傳承 image: https://hackmd.io/_uploads/rJpAHerNn.png --- ## part 1. 基本指令 https://blog.ossii.com.tw/?p=2241# - `ls` - 列出工作路徑下的檔案或是目錄清單 - `cd` - 切換目錄的路徑 - `pwd` - 列印工作路徑 - `cp <A> <B>` - 拷貝檔案A到B - 用`-r`複製目錄: - `cp -r path/to/dir/a path/to/dir/b` - `mv <A> <B>` - 移動 - 重新命名也是這樣用 - 用`-r` 移動目錄 - `touch <FILENAME>` - 碰一下 - 建立一個空的文件檔 - `mkdir <DIR-NAME>` - 建立新資料夾 - `rm <FILENAME>` - 刪除檔案 - 加 `-r` 刪資料夾 - 加 `-f` 強制 - `sudo <指令>` - 以 root(管理員aka超級使用者)權限執行指令 - 注意!危險!小心使用! - 執行後要輸入密碼 - `sudo su` - 成為root使用者 - `ln` - 建立“連結” - https://blog.gtwang.org/linux/linux-ln-command-tutorial-examples/ - https://ithelp.ithome.com.tw/articles/10222754 - 常用 ln -s 將執行檔 link 到 bin 目錄當中(linux中的==安裝==) - `chmod` - 變更檔案權限 - 參考網址:https://weikaiwei.com/linux/chmod-commands/ - `cat` - 把某個檔案的東西在終端機中印出來 - https://weikaiwei.com/linux/cat-command/ - 會和pipe結合成怪怪用法 - `echo <A>` - 終端機就會輸出`<A>` - 會和`>` `>>`結合成怪怪用法 - `>` `<` `>>` - `<` - `指令 < 檔案` - 將檔案的東西導入指令的“輸入流” - `>` - `指令 > 檔案` - 將指令的“輸出流”輸出到檔案(原檔案內容會被洗掉) - `>>` - `指令 >> 檔案` - 將指令的“輸出流”輸出到檔案(添加在原檔案內容後面) - `neofetch` - 出現這個酷東東 - ![](https://hackmd.io/_uploads/HJfCWmaO2.png) - `gcc`、`g++` - 就...gcc和g++ - `ssh` - 遠端連線 - `ssh username@ip-address` - 例如:`ssh fgisc@203.64.52.132` - `scp` - 遠端複製檔案 - https://blog.gtwang.org/linux/linux-scp-command-tutorial-examples/ - `zip`、`unzip` - https://www.ltsplus.com/linux/linux-zip-unzip - `man` - 教學文件 - `man <指令>` - 得到 `<指令>` 的文件內容 - 例如:`man git` - ![](https://hackmd.io/_uploads/BJGV776d3.png) ## part 2. apt - `apt update` - `apt upgrade` - `apt install <PACK>` - `apt remove <PACK>` - `apt reinstall <PACK>` ## part 3. vim vim 是一個很棒的文字編輯器。 https://ithelp.ithome.com.tw/articles/10255325 不過,其實只要知道基本的存檔、退出、編輯就好了。 ``` # 編輯檔案 vim filename.txt ``` 進入會到一般模式,按 `h` `j` `k` `l` 分別可以將游標往 `右` `下` `上` `左` 移動。 按`i`進入編輯模式(就會跟一般文字編輯器一樣可以打字),按`esc`退出編輯模式。 在一般模式中,`:w` 是存檔,`:q` 是退出 ## part 4. git 多多少少學著用吧,可以自己去網路上找相關文章 以下是一個常用指令表,[source](https://github.com/hellojs-tw/git-101/blob/master/cheat-sheet.md) * `git init` 建立新的本地端 Repository。 * `git clone [Repository URL]` 複製遠端的 Repository 檔案到本地端。 * `git status` 檢查本地端檔案異動狀態。 * `git add [檔案或資料夾]` 將指定的檔案(或資料夾)加入版本控制。用 `git add .` 可加入全部。 * `git commit` 提交(commit)目前的異動。 * `git commit -m "提交說明內容"` 提交(commit)目前的異動並透過 `-m` 參數設定摘要說明文字。 * `git stash` 獲取目前工作目錄的 dirty state,並保存到一個未完成變更的 stack,以方便隨時回復至當初的 state。 * `git log` 查看先前的 commit 記錄。 * `git push` 將本地端 Repository 的 commit 發佈到遠端。 * `git push origin [BRANCH_NAME]` 發佈至遠端指定的分支(Branch) * `git branch` 查看分支。 * `git branch [BRANCH_NAME]` 建立分支。 * `git checkout [BRANCH_NAME]` 取出指定的分支。 * `git checkout -b [BRANCH_NAME]` 建立並跳到該分支。 * `git branch -D [BRANCH_NAME]` 強制刪除指定分支(須先切換至其他分支再做刪除)。 * `git reset --hard [HASH]` 強制恢復到指定的 commit(透過 Hash 值)。 * `git checkout [HASH]` 切換到指定的 commit(與 `git checkout [BRANCH_NAME]` 相同)。 * `git branch -m <OLD_BRANCH_NAME> <NEW_BRANCH_NAME>` 修改分支名稱。

    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