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-11
LINUX-2
https://hackmd.io/@IMOK/Lab11
講師: 賴昱有
HOW TO 魔改 TERMINAL
Bash vs Z Shell
https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh
)"https://github.com/romkatv/powerlevel10k.git
\({ZSH_CUSTOM:-\)HOME/.oh-my-zsh/custom}/themes/powerlevel10khttps://github.com/zsh-users/zsh-syntax-highlighting.git
SSH
用法 : ssh {user}@{host}
e.g. ssh b0135XXXX@linux.aclab.cool
or 使用 GUI (Bitvise SSh Client)
VIM
文字介面編輯器
一開始是 normal mode 按 i 進入 edit mode
按 ESC 回到 normal mode
在 normal mode 打冒號可以輸入指令
vim 是個很強大的編輯器
在 normal mode 可以用的指令還有連技超多
如果想了解的可以看看 這個Vim
推薦要學 只能用文字介面的時候非常好用
JOE
另一個文字介面編輯器
joe filename.txt
COMMANDS
如果不知道指令怎麼用 請參考
command –help
man command
Quick search table
DF
列出磁碟剩餘空間
e.g.df -h
DU
列出資料夾所占空間
e.g. du –max-depth 1 -h .
FREE
列出記憶體使用狀況
e.g. free -h
GCC
編譯 c 語言檔案
e.g. gcc main.c
G++
編譯 c++ 語言檔案
e.g. g++ main.cpp
PROCESSES AND JOBS
在指令後面加上 & 可以放到背景執行
e.g. sleep 60 &
用 ps 列出當前所有 process
用 jobs 可以看到正在背景執行的 process
執行程式時可以用組合鍵 Ctrl+c 傳送停止訊號
或是用 Ctrl+z 將程式暫停後放到背景
放到背景後可以用 fg %1 把它放到前景繼續執行
或是 bg %1 讓他在背景繼續執行
可以使用 kill %1 對程式發送訊號
kill 並不是只能發送停止訊號
REDIRECTION
overwrite:echo "string" > file.txt
append:echo "string2" >> file.txt
PIPE
cat file.txt | grep "apple"
cat /proc/meminfo | grep Pages | sort
du -d 1 -h | sort -h
WILDCARDS
ls *.txt
cat file *
ARCHIVING
GNU / Linux 各種壓縮與解壓縮指令 - 凍仁的筆記
作業網站
作業做完請上傳到 http://140.121.197.13/tutorial
並且注意上傳時間限制、檔名、其他規範
上課時提前做完可以直接給助教 demo 登記
就不需要上傳 demo 過的部分
Question 1
Count the disk usage of your wwwdirectory.Question 2
Write a program to find the prime numbers
between 1 and 10000 and compile it using gcc or g++.
Question 3
Execute the file and redirect the output to the file primes.txt.
Question 4
Insertion sort intro
Allow the user to input 10 numbers, then sort them using the insertion sort and
save the sorted result to a file isort10.txt.
Question 5
Complete the 99 multiplication table using only one loop

and output the result to a file named 1loop99.txt.