or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
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.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
計算機概論Lab-10
LINUX
https://hackmd.io/@IMOK/Lab10
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →講師: 賴昱有
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →OS
UNIX
20 世紀 70 年代由 AT&T 的貝爾實驗室開發多使用者、多任務的作業系統
UNIX LIKE
模仿了 Unix 的設計與概念的衍生系統其中 BSD 系列與 MacOS 較為知名
GNU
GNU's Not Unix!
推動自由、開源軟體的組織
最初的目標是建立一個完整的作業系統替代Unix
其提供工具包含GCC、Bash、glibc等
原使用GNU Hurd後使用Linux kernel作為核心
如 Debian、Ubuntu、Red Hat皆為GNU/Linux系統
Terminal
Terminal or Console為用戶與主機進行互動的硬體裝置
如今多數情況下,通常指的是 CMD(命令提示字元)等虛擬介面。
Shell
使用者與作業系統之間的接口

將使用者指令解析後,與作業系統內核(Kernel)進行溝通
常見的Shell種類
Bourne Shell(sh):最早期的 SHELL,由 UNIX 開發。
Bash(Bourne Again Shell):基於 Bourne Shell,加入許多新功能。
C Shell(csh):以 C 語言語法為基礎,適合熟悉 C 語言的使用者。
Korn Shell(ksh):結合 Bourne Shell 和 C Shell 的優點,適用於高效能腳本需求。
Z Shell(zsh):功能非常強大,兼容 Bash,但在腳本撰寫、介面美化及插件支援方面表現更佳。
Windows powershell : 內建於Windows系統,僅限於 Windows 作業系統使用。
ssh(secure shell)
是一種遠端連線的協定
不過是文字介面的
使用非對稱式加密 相比 telnet 更安全
用法 : ssh {user}@{host}
e.g. ssh b0135XXXX@linux.aclab.cool
or 使用 GUI (Bitvise SSh Client)
SFTP (Secure File Transfer Protocol)
基於 SSH 的檔案傳輸協議,提供類似於 FTP 的功能,但所有通信都經過加密。
提供了文件操作的完整功能,如檔案上傳、下載、刪除、檔案權限修改等。)
SCP (Secure Copy Protocol)
基於 SSH 的檔案傳輸工具,用於快速、安全地傳輸檔案。
它的功能比 SFTP 簡單,主要專注於檔案的上傳和下載。)
檔案系統結構
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →檔案權限
列出檔案 ls -l
- rwx r- - r- -
chmod 666 example.txt
COMMANDS
如果不知道指令怎麼用 請參考
command –help
man command
Quick search table
CHSH (YPCHSH)
修改預設登入 shell
e.g.chsh /bin/tcsh
PASSWD (YPPASSWD)
修改密碼
e.g. passwd
CHMOD
修改檔案權限
e.g. chmod 777 file
LS
列出目錄中的檔案與目錄列表
常用參數 -l -h -a
e.g. ls -alh
CD
進入資料夾
e.g. cd Documents
PWD
顯示目前的目錄位置
ECHO
輸出文字
e.g. echo "Hello World!!!"
輸入檔案用法:
e.g. echo "Hello World!!!" > file
CAT
叫貓貓去看一下檔案檢視檔案內容
e.g. cat file
HEAD
檢視檔案前x行
常用參數 -n
e.g. head -n 10 file
TAIL
檢視檔案最後x行
常用參數 -n
e.g. tail -n 10 file
GREP
g/re/p(globally search a regular expression and print)
e.g. grep "apple" example.txt
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →grep -i "apple" example.txt for case-insensitive
CP
複製
e.g. cp hello hello-copy
MV
移動、更名
e.g. mv hello ../hello
MKDIR
創建資料夾
e.g. mkdir my-dir
VIM
文字介面編輯器
一開始是 normal mode 按 i 進入 edit mode
按 ESC 回到 normal mode
在 normal mode 打冒號可以輸入指令
vim 是個很強大的編輯器
在 normal mode 可以用的指令還有連技超多
如果想了解的可以看看 這個Vim
推薦要學 只能用文字介面的時候非常好用
JOE
另一個文字介面編輯器
joe filename.txt
作業網站
作業做完請上傳到 http://140.121.197.13/tutorial
並且注意上傳時間限制、檔名、其他規範
上課時提前做完可以直接給助教 demo 登記
就不需要上傳 demo 過的部分
Question 1
Create a directory named www.Question 2
Change the permission of the directory www to drwxr-xr-x, and explain what does this mean.
Question 3
From the previous exercises, upload your personal web page to the www directory. Use http://linux.aclab.cool/~b0135XXXX/ to view the page.
Question 4
Copy the file /proc/cpuinfo to your directory, and rename the file to CPU (case sensitive).
Question 5
Dump (show) the content of the file CPU and isolate
(using Linux commands) the CPU model.
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →