14
Learn linux command Learn linux command 學習常用的 linux 指令 學習常用的 linux 指令

Learn linux command

Embed Size (px)

Citation preview

Page 1: Learn linux command

Learn linux commandLearn linux command

學習常用的 linux 指令學習常用的 linux 指令

Page 2: Learn linux command

Command LineCommand Line

● 控制電腦的文字介面● 可以輸入指令

1. 按鍵盤觸發中斷

2. CPU 處理中斷,把字碼放進緩衝區

3. Terminal 讀取緩衝區,印在螢幕上

4. 如果按下的是 enter ,就執行該指令● 使用方式:

$ type something ... 然後按 enter

● 控制電腦的文字介面● 可以輸入指令

1. 按鍵盤觸發中斷

2. CPU 處理中斷,把字碼放進緩衝區

3. Terminal 讀取緩衝區,印在螢幕上

4. 如果按下的是 enter ,就執行該指令● 使用方式:

$ type something ... 然後按 enter

Page 3: Learn linux command

Command LineCommand Line

● 請先登入● 左上角找一下 Terminal ,點開

Page 4: Learn linux command

ls

● 查看目錄下有哪些檔案● 全名為: list segments

現在的 files 以前叫作 segments

Page 5: Learn linux command

ls

● 使用方式:$ ls

Page 6: Learn linux command

cd

● 切換目錄● 全名為: change directories

Page 7: Learn linux command

cd

● 下一層目錄:$ cd directory_name

● 上一層目錄:$ cd ..

● 家目錄:$ cd

● 特定目錄:$ cd /etc

Page 8: Learn linux command

mkdir

● 建立目錄● 全名為: make directory

● 使用方式:$ mkdir new_directory_name

Page 9: Learn linux command

cp

● 複製檔案● 全名為: copy

● 使用方式:$ cp directory_or_file new_directory_or_file

Page 10: Learn linux command

vi

● 新增、編輯、儲存檔案● 學習門檻高,礙於時間暫不介紹

Page 11: Learn linux command

gedit

● 新增、編輯、儲存檔案● 視窗化介面● 使用方式:

$ gedit file_name

Page 12: Learn linux command

mv

● 移動、重新命名檔案● 全名為: move

● 使用方式:$ mv directory_or_file new_directory_or_file

Page 13: Learn linux command

rm

● 刪除檔案● 全名為: remove

● 使用方式:$ rm file

$ rm -r directory

Page 14: Learn linux command

Hello world !Hello world !

● 在家目錄下建立一個目錄叫 hello

● 切進去 hello

● 新增並編輯 hello.c

● 編譯 hello.c

$ gcc hello.c -o hello● 執行 hello

$ ./hello● 刪除 hello 目錄

● 在家目錄下建立一個目錄叫 hello

● 切進去 hello

● 新增並編輯 hello.c

● 編譯 hello.c

$ gcc hello.c -o hello● 執行 hello

$ ./hello● 刪除 hello 目錄