- 命令格式
[root@localhost~]#command [-options] parameter1 parameter2 ...
1 Linux命令從前到後依次爲:命令、選項、參數1、參數2;
2 加入選項設定時,通常選項前會帶-號(短選項),有時候會使用選項的完整全名,則選項前帶有--符號,如--help(長選項);
3 指令、選項、參數中間以空格來區分,不論空幾格shell都視爲一格;
- 語系
1 [root@localhost ~]# echo $LANG 2 zh_CN.UTF-8 3 [root@localhost ~]# locale 4 LANG=zh_CN.UTF-8 5 LC_CTYPE="zh_CN.UTF-8" 6 LC_NUMERIC="zh_CN.UTF-8" 7 LC_TIME="zh_CN.UTF-8" 8 LC_COLLATE="zh_CN.UTF-8" 9 LC_MONETARY="zh_CN.UTF-8" 10 LC_MESSAGES="zh_CN.UTF-8" 11 LC_PAPER="zh_CN.UTF-8" 12 LC_NAME="zh_CN.UTF-8" 13 LC_ADDRESS="zh_CN.UTF-8" 14 LC_TELEPHONE="zh_CN.UTF-8" 15 LC_MEASUREMENT="zh_CN.UTF-8" 16 LC_IDENTIFICATION="zh_CN.UTF-8" 17 LC_ALL= 18 [root@localhost ~]# LANG=zh_CN.UTF-8
- 快捷鍵
tab:命令補全+文件名補全
ctrl+c:終端目前程序
ctrl+d:鍵盤輸入結束,如果你想直接離開文字接口,可以直接按下ctrl+d就能直接離開了(等價於輸入exit)
- 命令幫助
1 command --help能夠將一個指令的用法做一個大概的理解;
2 man command
- 正確關機方法
1 執行who命令查看當前誰在線
2 將數據同步寫入磁盤中的命令:sync
3 慣用關機命令:shutdown
shutdown -r 停掉系統服務後重新啓動
shutdown -h now 停掉系統服務後立即關機
4 慣用重啓命令:reboot
5 systemctl reboot直接重啓
systemctl poweroff 系統關機
在新版本中shutdown、reboot、half、poweroff命令都是呼叫的systemctl指令
- 查看本機訪問互聯網時使用的出口IP
[root@localhost]# curl ifconfig.me 182.92.163.68 [root@localhost]#