# Linux基本指令 [Linux 命令大全](https://www.runoob.com/linux/linux-command-manual.html) [Linux 基本認識與常用指令整理](https://dylan237.github.io/linux-basic.html) * 快捷鍵Ctrl + Alt + t 打開終端機視窗 1. 『↑』:列出打過的上一個指令 2. 按『Tab』鍵,可自動補全檔案或目錄名稱 * ls:list,查看檔案及子目錄 列出基本資料夾資料: ```shell $ ls ``` 列出詳細資料和隱藏資料(-l 列出詳細資料 -a 列出隱藏資料): ```shell $ ls -la ``` * pwd:print work directory,印出目前工作目錄 ```shell $ pwd ``` * cd:change directory,移動進入資料夾 移動到目前資料夾下的 examples 資料夾: ```shell $ cd ./example ``` 移動到家目錄: ```shell $ cd ~ ``` 移動到上一層目錄: ```shell $ cd .. ``` 移動到根目錄: ```shell $ cd / ``` * mkdir:make directory,創建新資料夾 ```shell $ mkdir examples ``` * mv:move (rename) files,移動檔案或是重新命名檔案 移動檔案 ```shell $ mv README.md /examples/README.md ``` 重新命名 ```shell $ mv README.md README_MV.md ``` * rm:remove file,刪除檔案 ```shell $ rm README.md ``` * touch:用來更新已存在文件的 timestamp 時間戳記或是新增空白檔案 ```shell $ touch README.md ``` * gedit 檔案 : 用gedit 開啟某檔案 編輯 ```shell $ gedit README.md ``` * ping:網路檢測工具,透過發送 ICMP ECHO_REQUEST 的封包,檢查自己與特定設備之間的網路是否暢通,速度是否正常 可輸入 hostname 或是 IP: ```shell $ ping google.com ``` * sudo:使用最高權限(superuser)執行指令,會要求輸入自己密碼,使用上必須非常小心 reboot: 重新開機 ```shell $ sudo reboot ``` shutdown now : 立即關機 ```shell $ sudo shutdown now ``` * 查看指令說明 ```shell= $ man ls $ ls --help ``` * apt-get:套件管理工具 更新套件資料庫列表: ```shell $ sudo apt-get update ``` 升級套件並下載安裝套件: ```shell $ sudo apt-get upgrade ``` 安裝套件: ```shell $ sudo apt-get install nano ``` 移除套件: ```shell $ sudo apt-get remove nano ```
×
Sign in
Email
Password
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