文本操作命令:cut
cut -d: -f1 /etc/passwd
-d, --delimiter=DELIM
use DELIM instead of TAB for field delimiter
-f, --fields=list
select only these fields;also print any line that contains no delimiter character,unless the -s option is specified
tr -d 刪除 tr -d 'a' < a.txt
tr 'a-z' 'A-Z' < a.txt
wc:文本統計命令
-l 行數
-w 單詞數
-c 字符數
sort
-r 降序
-n 按數值大小排序
-k 指定字段
-t 指定字段分隔符
命令行編輯:
ctrl+a 行首 ctrl+e 行尾 ctrl+u 刪除光標到行首 ctrl+k 刪除光標到行尾 !! !n
調用上一個命令的最後一個參數
Esc . 或 Alt+.
type which who whoami
echo $HISTSIZE
echo $HISTFILE
echo $HISTFILESIZE
HISTCONTROL=ignorespace
ignoredups
history -c 清空記錄