Try   HackMD

伴伴學 x HACK a nice day:Linux for Beginners

活動進行摘要

  • Zoom 聊天室用
FB社團: https://www.facebook.com/groups/accomdemy
分享共筆: https://hackmd.io/@andrewintw/ByP9nsesO
活動一覽: https://hackmd.io/@accomdemy/rkmKTY1Yu
  • 分享時間 (section1~3)
  • 玩玩 GitHub (有時間的話)
    • 從伴伴學 github fork accomdemy
    • 把這份共筆 push 到我的 forked repo
    • 對伴伴學 github 送出 pull request (PR)
    • Ref: commit emoji

預先準備軟體

在課程之前,你可以事先下載(甚至安裝)以下的軟體

Section 1 前導

What is OS

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

  • Application 和 Hardware 之間的中介層
  • 控制硬體的資源(RAM、儲存空間、行程
    • 執行 WORD 的時候,需要 OS 配記憶體資源給 WORD 運作
    • 下載 5GB 的檔案時,OS 需要保留能夠存放 5GB 資料的資源(ex: 硬碟空間)

Linux 歷史

  • 1985, GNU Project, Richard Stallman(RMS)
  • 1987/5/23, GCC (GNU Compiler Collection/GNU C Compiler)
  • 1989/6/8, bash
  • 1991/8/25, comp.os.minix Newsgroup

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

  • 1991/9/17, linux kernel 0.01 Released (10,239 lines)
  • 芬蘭三寶
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →
    :聖誕老人、Nokia、Linux
  • 1993, Red Hat, Inc
  • 1993/9/15, Debian 0.01 Released
  • Hacker 文化

Linux Distribution

Section 2 建立 Linux 環境

  • Multi-booting (多重開機)

What is virtualization (虛擬化技術)

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Lab Time!

  • Create your First Virtual Machine
  • Install Ubuntu OS on Virtual Machine

Section 3 CLI & Linux File System Hierarchy

SSH 連線

  • ip address
  • port > service

基礎指令

  • ls
  • cd
  • pwd
  • mkdir
  • touch
  • cp
  • mv
  • rm
  • cat
  • less

安裝套件

$ sudo apt-get update
$ apt-cache search <pkgname> # 搜尋套件
$ sudo apt-get install <pkgname>  # 安裝

Linux vs Windows

其他你應該知道的

  • 行程相關 ps, kill, jobs, &
  • 導向操作 >, >>, 1>, 2>, 2>&1
  • 管線操作 |
  • xargs
  • awk
  • sed
  • tr
  • vim 或 nano 編輯器的使用

補充 (如果有時間的話)

工商時間
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Learn Linux with the Raspberry Pi 是今年 3 月份在 HACK a nice day 社團執行的線上分享計畫。

目的是帶領大家透過 Raspberry Pi 官網的資料去學 Linux。目前執行了兩個系列分享:「Raspberry Pi Documentation 導讀」以及「Linux Command Night」。

Raspberry Pi Documentation 導讀

主要是導讀 Pi 官方的文件。

分享筆記

part1 忘記錄影了

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
不過不太重要 XD

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Linux Command Night

主要是分享 Linux 指令,這些都是我工作上會用到的指令和觀念。

分享筆記

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

特定主題分享 (內網穿透)

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Q&A

- Q from Paul: 如何盈利?
- A from Andrew & 黑貓: 有分社群版本或企業版,可能是靠企業版在賺錢(實際上不是靠企業版在賺錢的)在購買官方技術支援的時候才付費,Ubuntu本身是沒有在營利的,但相關技術支援公司Canonical 公司有在盈利。
- 馬爸之後可以分享Linux的賺錢模式
- Q from Adam: Virtual Box還支援32位元嗎?
- A from Andrew: 現在還有支援
- A from Jerry: https://www.virtualbox.org/wiki/Downloads
上面沒寫清楚
不知道32bit os是否可以安裝
- A from Will: If you're looking for the latest VirtualBox 5.2 packages, see VirtualBox 5.2 builds. Please also use version 5.2 if you still need support for 32-bit hosts, as this has been discontinued in 6.0. Version 5.2 will remain supported until July 2020. 所以能用的只有5.2
- A from Zhu Qi: 補充一下,一般Vitual box / VMWare 等虛擬機軟體,都能支持32-bit/64-bit的.iso鏡像安裝包
- Q from Bruce: 請問有用過WSL嗎 
- A from Andrew: 沒用過,待會可以玩玩看
- A from 舜傑:用過,讚讚
- Q from 皮爸:如果有兩個鍵盤,兩個滑鼠,可以操作嗎?
- A from Andrew: 可以,但是不太知道為什麼
- A from Jerry: 以前有這樣的設備,以前電腦貴,真的有這樣的裝置在賣
- Q from 皮爸: 真的很像docker,為什麼不用docker?
- A from Andrew: VM比較像機器,要裝什麼就裝什麼。Docker有相依性的問題,如果熟的話也可以用Docker。Virtual box建立網路拓墣很方便。可以搜尋vagrant vs docker
- Sharing from Adam: 16.4 ubuntu 有中文版。
- A from Will: VM是從硬體開始模擬,模擬完整的電腦。Docker還是需要靠主機系統。
- Q from Paul: what is sudo?
- A from Dar: super user do
- A from Andrew: Sudo 事實上是一個群組,有加入這個群組的人就可以使用這個指令,執行root的權限
- Q from 皮爸:副檔名
- A from Andrew: 關於.exe檔可以用file指令來看看
- Q from 皮爸:apt可以下載,但公司網路有限制,有辦法離線安裝嗎?
- A from Andrew: 用deb這個關鍵字搜尋,可以使用manual install
- A from Dar: https://pkgs.org/download/apt-offline
- https://gist.github.com/ycku/fa3110bce427cf2c1f1ca4a680d594e8
- A from Dahai: https://www.debian.org/distrib/packages
- A from Will: /etc/apt/source.conf
- 裡面就藏.DEB的主機
- 不然就是找package mirror server
From Dar:
保護 電腦不輸入 rm

http://blog.xsoin.com/2016/10/rm-rf.html

alias rm = trash
trash() {
  mv $@ ~/.trash/
}

alias rm='echo "This is not the command you are looking for."; false'

完整聊天紀錄

我對所有人說: 07:51 PM
@@ 你是紫彤嗎?
Tzu Tung Lee對所有人說: 07:52 PM
我是 XD
我對所有人說: 07:54 PM
:)
Maggie對所有人說: 08:05 PM
皮爸是邊吃邊聊嗎 哈
大家都吃飽了嗎
皮爸對所有人說: 08:06 PM
歹勢 哈哈哈
Maggie對所有人說: 08:09 PM
你也太晚吃飯了~~~
話說will who跟之前的老朋友will是同一位嗎~
我對所有人說: 08:11 PM
FB社團: https://www.facebook.com/groups/accomdemy
分享共筆: https://hackmd.io/@andrewintw/ByP9nsesO
活動一覽: https://hackmd.io/@accomdemy/rkmKTY1Yu
Paul Hsu對所有人說: 08:12 PM
me
Maggie對所有人說: 08:12 PM
手可以放下了嗎
Will Who對所有人說: 08:12 PM
是的maggie
皮爸對所有人說: 08:12 PM
XD
Maggie對所有人說: 08:23 PM
好奇今天第一次參與的新同學是從哪邊知道伴伴學的活動啊?
Dahai Pon對所有人說: 08:28 PM
Debian發行版本名是用玩具總動員的角色
黑貓對所有人說: 08:28 PM
原來是這樣嗎xddd
Dahai Pon對所有人說: 08:28 PM
ubuntu來自南非
黑貓對所有人說: 08:28 PM
我都沒注意到欸
Paul Hsu對所有人說: 08:28 PM
好奇他們怎麼賺錢
Maggie對所有人說: 08:28 PM
好有趣😂
Paul Hsu對所有人說: 08:28 PM
還是完全非營利
Dahai Pon對所有人說: 08:33 PM
我不用IE我都用PCMAN
皮爸對所有人說: 08:33 PM
我都用KKMAN
Dahai Pon對所有人說: 08:34 PM
XD
Jerry Yeh對所有人說: 08:34 PM
https://forum.ubuntu.org.cn/viewtopic.php?t=489877
黑貓對所有人說: 08:34 PM
https://canonical.com/
鄭鴻旗對所有人說: 08:35 PM
https://forum.lxde.org/viewtopic.php?t=437&start=120
當年投稿設計 lubuntu
Paul Hsu對所有人說: 08:37 PM
謝謝回答~
我順便把Q&A整理在Andrew做的共筆上面:https://hackmd.io/@andrewintw/ByP9nsesO
有人在臉書直播問:GRUB?
Marconi對所有人說: 08:39 PM
隨著 AI 的流行, google 的 AI 工具 colab 也是基於 ubuntu 版本, 也有越來越多人把 colab 當 ubuntu 來玩
馬爸對所有人說: 08:39 PM
要離開一下
若有興趣再補充 Linux 賺錢的模式
Paul Hsu對所有人說: 08:40 PM
期待馬爸分享
Maggie對所有人說: 08:40 PM
Marconi後來有找到合適的人才嗎~
鄭鴻旗對所有人說: 08:40 PM
馬爸,我想聽~
黑貓對所有人說: 08:50 PM
通常舊電腦 我都直接裝linux了
XDDD
Will Who對所有人說: 08:51 PM
只有32bit的大概15年了吧
建議換掉,隨便一台小電腦耗電跟效能都贏
鄭鴻旗對所有人說: 08:51 PM
超老筆電....
陳 洛桐對所有人說: 08:51 PM
其實也是可以,請問有關鍵字嗎,還是直接google就好
那台年紀比我還大
Jerry Yeh對所有人說: 08:52 PM
https://www.virtualbox.org/wiki/Downloads
上面沒寫清楚
不知道32bit os是否可以安裝
陳 洛桐對所有人說: 08:52 PM
加減用而已,不然我就要拿來練焊接了........
Maggie對所有人說: 08:52 PM
建議留著做古董收藏😂😂
陳 洛桐對所有人說: 08:53 PM
我再找找看好了,我也是看到這個
Will Who對所有人說: 08:53 PM
If you're looking for the latest VirtualBox 5.2 packages, see VirtualBox 5.2 builds. Please also use version 5.2 if you still need support for 32-bit hosts, as this has been discontinued in 6.0. Version 5.2 will remain supported until July 2020.
Jerry Yeh對所有人說: 08:53 PM
電子產品要收藏很累
Will Who對所有人說: 08:54 PM
所以你能用的就5.2
Bruce對所有人說: 08:54 PM
RS232真是時代的眼淚
黑貓對所有人說: 08:55 PM
現在RS232/RS485都還有在用
Jerry Yeh對所有人說: 08:55 PM
終端機時代連線都是rs-232
Bruce對所有人說: 08:55 PM
現在都用USB 轉RS232或485
Jerry Yeh對所有人說: 08:56 PM
Rs-232不死的
黑貓對所有人說: 08:56 PM
我之前有在玩PLC 也是用USB to RS232
Bruce對所有人說: 08:57 PM
以前玩8051還要自己用一組rs2323轉uart的電路
現在好方便
黑貓對所有人說: 08:58 PM
科技的進步啊
Paul Hsu對所有人說: 08:59 PM
lol
Maggie對所有人說: 08:59 PM
引導者有自己ㄉ堅持
皮爸對所有人說: 08:59 PM
哈哈哈
Maggie對所有人說: 08:59 PM
殼以啊
皮爸對所有人說: 08:59 PM
給你一個讚
黑貓對所有人說: 08:59 PM
要硬就硬起來
讚
Maggie對所有人說: 08:59 PM
棒
陳 洛桐對所有人說: 08:59 PM
讚~~~
鄭鴻旗對所有人說: 08:59 PM
敬他的堅持
Bruce對所有人說: 09:00 PM
請問有用過WSL嗎
舜傑 張對所有人說: 09:00 PM
我有過
黑貓對所有人說: 09:02 PM
WSL也很好用
我離開一下 裝個WSL
Paul Hsu對所有人說: 09:02 PM
行動派
Yang-Hsiang Chang對所有人說: 09:03 PM
https://cocalc.com/doc/terminal.html 發現一個 Online Linux Terminal
Jerry Yeh對所有人說: 09:07 PM
沒試過,感覺是雙螢幕,二個人共用一台電助
電腦
是的
就是這樣
Marconi對所有人說: 09:07 PM
就是 server 的概念
Paul Hsu對所有人說: 09:07 PM
虛擬網咖
Jerry Yeh對所有人說: 09:07 PM
以前有這樣的設備
阿好伯對所有人說: 09:07 PM
乾脆也虛擬WIN10
皮爸對所有人說: 09:08 PM
有點搞笑
黑貓對所有人說: 09:08 PM
現在也是可以這樣做 方法很多
Jerry Yeh對所有人說: 09:08 PM
以前電腦貴,真的有這樣的裝置在賣
黑貓對所有人說: 09:08 PM
有對岸的公司連每個人的主機環境也這樣幹
Jerry Yeh對所有人說: 09:12 PM
做隨身碟
Paul Hsu對所有人說: 09:13 PM
聽起來好方便
Will Who對所有人說: 09:13 PM
大公司很多都這樣,還有網咖也是
Bruce對所有人說: 09:13 PM
每次都可以聽到新奇的東西真好
黑貓對所有人說: 09:14 PM
確實
Will Who對所有人說: 09:14 PM
thin client
黑貓對所有人說: 09:14 PM
畢竟誰不想花錢管一堆獨立個體 還不如集中管理
Will Who對所有人說: 09:22 PM
moba的local terminal 其實也是linux
Will Who對所有人說: 09:29 PM
玩起來感覺就是virtualbox版本的docker hub
皮爸對所有人說: 09:42 PM
真的很像docker
那為何不用docker
Paul Hsu對所有人說: 09:51 PM
蠻棒的比喻
一下就懂了
黑貓對所有人說: 09:51 PM
細胞壁的概念
Dahai Pon對所有人說: 09:58 PM
以前掛載是掛「磁帶」
Will Who對所有人說: 10:00 PM
一般稱做樹狀結構
Jerry Yeh對所有人說: 10:02 PM
根目錄 家目錄要說明一下
絕對路徑與相對路徑
Dahai Pon對所有人說: 10:03 PM
TAB鍵
Paul Hsu對所有人說: 10:06 PM
跟貓貓有什麼關係
Jerry Yeh對所有人說: 10:08 PM
https://walker-a.com/archives/6571
Will Who對所有人說: 10:09 PM
沒有...工程師的浪漫
Jerry Yeh對所有人說: 10:09 PM
推一下這個,剛搞錯
黑貓對所有人說: 10:09 PM
先離開了 有事情要處理
Jerry Yeh對所有人說: 10:09 PM
晚安先下線了
Paul Hsu對所有人說: 10:09 PM
晚安
A0224460N ZHU QI對所有人說: 10:09 PM
晚安!
舜傑 張對所有人說: 10:11 PM
裝個sl指令來玩
Paul Hsu對所有人說: 10:13 PM
不好意思 剛剛有講到sudo指令的意思和用法嗎
Dahai Pon對所有人說: 10:13 PM
sl 哺哺
dar對所有人說: 10:15 PM
sudo =>  super user do
Paul Hsu對所有人說: 10:16 PM
Thanks Dar!
Dahai Pon對所有人說: 10:16 PM
可以敲碗 正規表示式 嗎?
Will Who對所有人說: 10:16 PM
那大概今天不用睡了
皮爸對所有人說: 10:17 PM
正規表達式超暈
天書
Dahai Pon對所有人說: 10:17 PM
下次啦
Paul Hsu對所有人說: 10:17 PM
如果所有人都可以用sudo指令,那何必分權限?
舜傑 張對所有人說: 10:18 PM
不是所有人都可用sudo
Will Who對所有人說: 10:18 PM
sudo有很詳細的設定,不是打了就可以用
Paul Hsu對所有人說: 10:18 PM
了解
舜傑 張對所有人說: 10:19 PM
可以做權限管理
dar對所有人說: 10:19 PM
https://kknews.cc/zh-tw/news/ab6g366.html
apt-get install sl  
火車
Paul Hsu對所有人說: 10:21 PM
cool~
Will Who對所有人說: 10:21 PM
ascii art
dar對所有人說: 10:22 PM
星際大戰 
telnet towel.blinkenlights.nl
鄭鴻旗對所有人說: 10:22 PM
https://hackmd.io/8AgJel5iR5Gq3_YL1Zvl0Q
Command Line Aesthetic 命令列美學
Paul Hsu對所有人說: 10:23 PM
是永久刪除嗎
Dahai Pon對所有人說: 10:25 PM
要小心 -rf
Will Who對所有人說: 10:26 PM
exit
Dahai Pon對所有人說: 10:26 PM
節目結束來下這個指令 哈哈
Will Who對所有人說: 10:28 PM
ssh pi@192.168.4.106
沒事...打錯
Paul Hsu對所有人說: 10:36 PM
蠻有趣的
舜傑 張對所有人說: 10:37 PM
是不是該找時間講WSL
dar對所有人說: 10:41 PM
https://pkgs.org/download/apt-offline
https://gist.github.com/ycku/fa3110bce427cf2c1f1ca4a680d594e8
Dahai Pon對所有人說: 10:41 PM
https://www.debian.org/distrib/packages
Will Who對所有人說: 10:43 PM
/etc/apt/source.conf
裡面就藏.DEB的主機
不然就是找package mirror server
dar對所有人說: 10:44 PM
保護 電腦不輸入 rm

http://blog.xsoin.com/2016/10/rm-rf.html

alias rm = trash
trash() {
  mv $@ ~/.trash/
}
alias rm='echo "This is not the command you are looking for."; false'
Paul Hsu對所有人說: 10:47 PM
要來去複習舜傑的分享了
Dahai Pon對所有人說: 10:55 PM
也可以用雙引號把有空白的字串包起來
Paul Hsu對所有人說: 10:59 PM
帥
Dahai Pon對所有人說: 11:02 PM
這兩位聲音有點像
我累了
Paul Hsu對所有人說: 11:02 PM
XDD
但可以懂欸
vagrant比較討厭
Wu對所有人說: 11:03 PM
收獲良多,感謝
Paul Hsu對所有人說: 11:03 PM
linux指令覺得可懂
@Wu 是第一次參加伴伴學嗎
Wu對所有人說: 11:04 PM
是的,第一次有出聲
Paul Hsu對所有人說: 11:04 PM
哈哈 歡迎以後再來共學
Wu對所有人說: 11:04 PM
好的,很充實,感謝
Paul Hsu對所有人說: 11:04 PM
神
sam對所有人說: 11:05 PM
讚
Paul Hsu對所有人說: 11:05 PM
但是講得很棒
吃宵夜r
Wu對所有人說: 11:05 PM
Andrew 很強
Paul Hsu對所有人說: 11:05 PM
話說舜傑也有敲碗WSL
舜傑 張對所有人說: 11:06 PM
WSL我可以講
dar對所有人說: 11:06 PM
https://regex101.com/
Paul Hsu對所有人說: 11:06 PM
讚讚
舜傑 張對所有人說: 11:06 PM
只是還要花時間準備
Paul Hsu對所有人說: 11:10 PM
預習
lol
Dahai Pon對所有人說: 11:10 PM
多謝