cut tr wc sort

文本操作命令: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   清空记录

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章