2015年8月13日 星期四

RH124_01_Access the command line

Linux兩種操作介面
1. Command Line: Shell (Bash, ZShell)
2. Graphic: KDE, GNOME

bash shell
1.一般使用者
   [student@desktopX ~]$
2.管理員root
   [root@desktopX ~]#

操作介面切換
Graphic切換至 Command Line:Ctrl+Alt+F2~F6
Command Line 切換至 Graphic:Ctrl+Alt+F1

Linux基本指令 Shell basics
Command [Option] Arguments
       指令            參數         目標

啟動 GNOME Help視窗
yelp
GNOME網站:https://www.gnome.org/

指令查詢
--help
$date --help
date [OPTION]... [+FORMAT]
man
man date
q 離開man page

離開shell
$exit
$logout
Ctrl+D

查詢日期時間
$date
2015年 8月13日 周四 10時00分00秒 CST
$date +R
08:13
$date +%x
2015/08/13
$date +%Y-%m-%d
2015-08-13

更換密碼
$passwd  輸入兩次密碼

檔案簡介
file 列出檔案類型(ASCII text, binary, directory...)
$file /etc/passed
$head /etc/passed 列出檔案內容前n行,預設10行
$tail /etc/passed 列出檔案內容後n行
$tail -n 3 /etc/passed 列出檔案內容後三行
$wc /etc/passwd 計算檔案line、words、characters
91 249 5581 passwd
$wc -l /etc/passwd 計算檔案 line
$wc -w /etc/passwd 計算檔案 words
$wc -c /etc/passwd 計算檔案 characters

指令編輯
[tab]  自動補齊檔名或路徑名稱
$history  列出過去打過指令
$!!s 列出最近下過的指令,例如 !!s
$!N  執行過去打過編號N行的指令,例如 !28
$!!    執行上一個指令
 列出上一個指令
;  分隔兩指令
$clear 清除指令
Esc+. copy the last argument of previous commands

沒有留言: