history

命令行历史记录

语法

  history 
  history [n]
  history -c
  history -d offset
  history [-anrw] [filename]
  history -ps arg

选项



   -c   清除历史记录列表.

   -d offset 
        删除偏移处的历史记录. 

   -a   附加新的历史记录行. 

   -n   附加尚未从历史文件中读取的历史记录行 
        到当前的历史列表 

   -r   读取当前历史文件并将其内容附加到历史列表中

   -w   将当前历史记录写入历史文件

   -p   执行历史记录替换并显示结果在标准输出上,
        不将结果存储在历史列表中

   -s   添加到历史列表的末尾


例子

查看历史执行记录:

$ history 
1  yum install screen
2  screen -S lnmp
3  pip
4  pip install Flask
...

查看历史执行记录后 2 条

$ history 2
1  yum install screen
2  screen -S lnmp
...

执行历史记录第 2 条命令

$ !2

执行上一条命令

$ !!

history 命令实例:

linux命令:history | grep pwd 113 2013-06-09 10:40:12 pwd 141 2013-06-09 10:40:12 pwd 198 2013-06-09 15:46:23 history | grep pwd 202 2013-06-09 15:47:39 history | grep pwd pwd grep | history 15:47:39 2013-06-09 pwd 202 grep | history 15:46:23 2013-06-09 pwd 198 10:40:12 2013-06-09 pwd 141 10:40:12 2013-06-09 pwd 113 grep | history history | grep pwd 113 2013-06-09 10:40:12 pwd 141 2013-06-09 10:40:12 pwd 198 2013-06-09 15:46:23 history | grep pwd 202 2013-06-09 15:47:39 history | grep pwdrootopen.com
linux命令:history | grep pwd 113 2013-06-09 10:40:12 pwd 141 2013-06-09 10:40:12 pwd 198 2013-06-09 15:46:23 history | grep pwd 202 2013-06-09 15:47:39 history | grep pwd pwd grep | history 15:47:39 2013-06-09 pwd 202 grep | history 15:46:23 2013-06-09 pwd 198 10:40:12 2013-06-09 pwd 141 10:40:12 2013-06-09 pwd 113 grep | history history | grep pwd 113 2013-06-09 10:40:12 pwd 141 2013-06-09 10:40:12 pwd 198 2013-06-09 15:46:23 history | grep pwd 202 2013-06-09 15:47:39 history | grep pwdrootopen.com
2018-09-11 09:55:30

linux命令:history -c -c history history -crootopen.com
linux命令:history -c -c history history -crootopen.com
2018-09-11 09:55:30

linux命令:history history history rootopen.com
linux命令:history history history rootopen.com
2018-09-11 09:55:30

linux命令:history history historyrootopen.com
linux命令:history history historyrootopen.com
2018-09-11 09:55:30

linux命令:history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head head | -rn sort | i}}' " " a[i] a){print in '{a[$2]++}END{for(i awk | history history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | headrootopen.com
linux命令:history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head head | -rn sort | i}}' " " a[i] a){print in '{a[$2]++}END{for(i awk | history history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | headrootopen.com
2018-03-01 12:42:48

linux命令:history | awk '{print $2}' | sort | uniq -c | sort -rn | head head | -rn sort | -c uniq | sort | $2}' '{print awk | history history | awk '{print $2}' | sort | uniq -c | sort -rn | headrootopen.com
linux命令:history | awk '{print $2}' | sort | uniq -c | sort -rn | head head | -rn sort | -c uniq | sort | $2}' '{print awk | history history | awk '{print $2}' | sort | uniq -c | sort -rn | headrootopen.com
2018-04-30 12:57:48

linux命令:history -w <switch to another terminal> history -r -r history terminal> another to <switch -w history history -w <switch to another terminal> history -rrootopen.com
linux命令:history -w <switch to another terminal> history -r -r history terminal> another to <switch -w history history -w <switch to another terminal> history -rrootopen.com
2018-05-01 14:30:48

linux命令:history -r -r history history -rrootopen.com
linux命令:history -r -r history history -rrootopen.com
2018-04-06 22:48:48

linux命令:history | perl -lane '$lsize{$_} = scalar(@F); if($longest<$lsize{$_}) { $longest = $lsize{$_}; print "$_"; };' | tail -n1 -n1 tail | };' "$_"; print $lsize{$_}; = $longest { if($longest<$lsize{$_}) scalar(@F); = '$lsize{$_} -lane perl | history history | perl -lane '$lsize{$_} = scalar(@F); if($longest<$lsize{$_}) { $longest = $lsize{$_}; print "$_"; };' | tail -n1rootopen.com
linux命令:history | perl -lane '$lsize{$_} = scalar(@F); if($longest<$lsize{$_}) { $longest = $lsize{$_}; print "$_"; };' | tail -n1 -n1 tail | };' "$_"; print $lsize{$_}; = $longest { if($longest<$lsize{$_}) scalar(@F); = '$lsize{$_} -lane perl | history history | perl -lane '$lsize{$_} = scalar(@F); if($longest<$lsize{$_}) { $longest = $lsize{$_}; print "$_"; };' | tail -n1rootopen.com
2018-01-03 01:24:48

linux命令:history | grep ssh ssh grep | history history | grep sshrootopen.com
linux命令:history | grep ssh ssh grep | history history | grep sshrootopen.com
2018-06-03 10:52:48

linux命令:history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c|sort -r -r -c|sort $1}'|sort|uniq {print {FS="|"} 'BEGIN $2}'|awk '{print history|awk history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c|sort -rrootopen.com
linux命令:history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c|sort -r -r -c|sort $1}'|sort|uniq {print {FS="|"} 'BEGIN $2}'|awk '{print history|awk history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c|sort -rrootopen.com
2018-02-04 08:03:48

linux命令:history -d -d history history -drootopen.com
linux命令:history -d -d history history -drootopen.com
2018-04-18 06:17:48

linux命令:history -c -c history history -crootopen.com
linux命令:history -c -c history history -crootopen.com
2018-05-24 09:08:48

linux命令:history -c -c history history -crootopen.com
linux命令:history -c -c history history -crootopen.com
2018-01-07 22:24:48

linux命令:history -c && rm -f ~/.bash_history ~/.bash_history -f rm && -c history history -c && rm -f ~/.bash_historyrootopen.com
linux命令:history -c && rm -f ~/.bash_history ~/.bash_history -f rm && -c history history -c && rm -f ~/.bash_historyrootopen.com
2018-04-22 03:05:48

linux命令:history | perl -F"\||<\(|;|\`|\\$\(" -alne 'foreach (@F) { print $1 if /\b((?!do)[a-z]+)\b/i }' | sort | uniq -c | sort -nr | head head | -nr sort | -c uniq | sort | }' /\b((?!do)[a-z]+)\b/i if $1 print { (@F) 'foreach -alne -F"\||<\(|;|\`|\\$\(" perl | history history | perl -F"\||<\(|;|\`|\\$\(" -alne 'foreach (@F) { print $1 if /\b((?!do)[a-z]+)\b/i }' | sort | uniq -c | sort -nr | headrootopen.com
linux命令:history | perl -F"\||<\(|;|\`|\\$\(" -alne 'foreach (@F) { print $1 if /\b((?!do)[a-z]+)\b/i }' | sort | uniq -c | sort -nr | head head | -nr sort | -c uniq | sort | }' /\b((?!do)[a-z]+)\b/i if $1 print { (@F) 'foreach -alne -F"\||<\(|;|\`|\\$\(" perl | history history | perl -F"\||<\(|;|\`|\\$\(" -alne 'foreach (@F) { print $1 if /\b((?!do)[a-z]+)\b/i }' | sort | uniq -c | sort -nr | headrootopen.com
2018-02-20 09:11:48

linux命令:history | awk '{a[$'$(echo "1 2 $HISTTIMEFORMAT" | wc -w)']++}END{for(i in a){print a[i] " " i}}' | sort -rn | head head | -rn sort | i}}' " " a[i] a){print in -w)']++}END{for(i wc | $HISTTIMEFORMAT" 2 "1 '{a[$'$(echo awk | history history | awk '{a[$'$(echo "1 2 $HISTTIMEFORMAT" | wc -w)']++}END{for(i in a){print a[i] " " i}}' | sort -rn | headrootopen.com
linux命令:history | awk '{a[$'$(echo "1 2 $HISTTIMEFORMAT" | wc -w)']++}END{for(i in a){print a[i] " " i}}' | sort -rn | head head | -rn sort | i}}' " " a[i] a){print in -w)']++}END{for(i wc | $HISTTIMEFORMAT" 2 "1 '{a[$'$(echo awk | history history | awk '{a[$'$(echo "1 2 $HISTTIMEFORMAT" | wc -w)']++}END{for(i in a){print a[i] " " i}}' | sort -rn | headrootopen.com
2018-02-08 04:56:48

linux命令:history | awk '{a[$'$(echo "1 2 $HISTTIMEFORMAT" | wc -w)']++}END{for(i in a){print a[i] " " i}}' | sort -rn | head head | -rn sort | i}}' " " a[i] a){print in -w)']++}END{for(i wc | $HISTTIMEFORMAT" 2 "1 '{a[$'$(echo awk | history history | awk '{a[$'$(echo "1 2 $HISTTIMEFORMAT" | wc -w)']++}END{for(i in a){print a[i] " " i}}' | sort -rn | headrootopen.com
linux命令:history | awk '{a[$'$(echo "1 2 $HISTTIMEFORMAT" | wc -w)']++}END{for(i in a){print a[i] " " i}}' | sort -rn | head head | -rn sort | i}}' " " a[i] a){print in -w)']++}END{for(i wc | $HISTTIMEFORMAT" 2 "1 '{a[$'$(echo awk | history history | awk '{a[$'$(echo "1 2 $HISTTIMEFORMAT" | wc -w)']++}END{for(i in a){print a[i] " " i}}' | sort -rn | headrootopen.com
2018-02-27 16:32:48

linux命令:history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head > /tmp/cmds | gnuplot -persist <(echo 'plot "/tmp/cmds" using 1:xticlabels(2) with boxes') boxes') with 1:xticlabels(2) using "/tmp/cmds" 'plot <(echo -persist gnuplot | /tmp/cmds > head | -rn sort | i}}' " " a[i] a){print in '{a[$2]++}END{for(i awk | history history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head > /tmp/cmds | gnuplot -persist <(echo 'plot "/tmp/cmds" using 1:xticlabels(2) with boxes')rootopen.com
linux命令:history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head > /tmp/cmds | gnuplot -persist <(echo 'plot "/tmp/cmds" using 1:xticlabels(2) with boxes') boxes') with 1:xticlabels(2) using "/tmp/cmds" 'plot <(echo -persist gnuplot | /tmp/cmds > head | -rn sort | i}}' " " a[i] a){print in '{a[$2]++}END{for(i awk | history history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head > /tmp/cmds | gnuplot -persist <(echo 'plot "/tmp/cmds" using 1:xticlabels(2) with boxes')rootopen.com
2018-01-26 14:54:48

linux命令:history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -n | tail | sort -nr -nr sort | tail | -n sort | -c uniq | sort | $1}' {FS="|"}{print 'BEGIN awk | $2}' '{print awk | history history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -n | tail | sort -nrrootopen.com
linux命令:history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -n | tail | sort -nr -nr sort | tail | -n sort | -c uniq | sort | $1}' {FS="|"}{print 'BEGIN awk | $2}' '{print awk | history history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -n | tail | sort -nrrootopen.com
2018-04-18 17:23:48

linux命令:history | awk '{print $2,$3}' | sed s/sudo// | awk '{print $1}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -n | tail | sort -nr -nr sort | tail | -n sort | -c uniq | sort | $1}' {FS="|"}{print 'BEGIN awk | $1}' '{print awk | s/sudo// sed | $2,$3}' '{print awk | history history | awk '{print $2,$3}' | sed s/sudo// | awk '{print $1}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -n | tail | sort -nrrootopen.com
linux命令:history | awk '{print $2,$3}' | sed s/sudo// | awk '{print $1}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -n | tail | sort -nr -nr sort | tail | -n sort | -c uniq | sort | $1}' {FS="|"}{print 'BEGIN awk | $1}' '{print awk | s/sudo// sed | $2,$3}' '{print awk | history history | awk '{print $2,$3}' | sed s/sudo// | awk '{print $1}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -n | tail | sort -nrrootopen.com
2018-01-06 17:23:48

linux命令:history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -n | tail | sort -nr -nr sort | tail | -n sort | -c uniq | sort | $1}' {FS="|"}{print 'BEGIN awk | $2}' '{print awk | history history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -n | tail | sort -nrrootopen.com
linux命令:history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -n | tail | sort -nr -nr sort | tail | -n sort | -c uniq | sort | $1}' {FS="|"}{print 'BEGIN awk | $2}' '{print awk | history history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -n | tail | sort -nrrootopen.com
2018-01-24 03:44:48

linux命令:history | tail -(n+1) | head -(n) | sed 's/^[0-9 ]\{7\}//' >> ~/script.sh ~/script.sh >> ]\{7\}//' 's/^[0-9 sed | -(n) head | -(n+1) tail | history history | tail -(n+1) | head -(n) | sed 's/^[0-9 ]\{7\}//' >> ~/script.shrootopen.com
linux命令:history | tail -(n+1) | head -(n) | sed 's/^[0-9 ]\{7\}//' >> ~/script.sh ~/script.sh >> ]\{7\}//' 's/^[0-9 sed | -(n) head | -(n+1) tail | history history | tail -(n+1) | head -(n) | sed 's/^[0-9 ]\{7\}//' >> ~/script.shrootopen.com
2018-03-06 12:45:48

linux命令:history -c -c history history -crootopen.com
linux命令:history -c -c history history -crootopen.com
2018-02-09 22:15:48

linux命令:history -s command command -s history history -s commandrootopen.com
linux命令:history -s command command -s history history -s commandrootopen.com
2018-04-02 13:47:48

linux命令:history | cut -c8- | sort | uniq -c | sort -rn | head head | -rn sort | -c uniq | sort | -c8- cut | history history | cut -c8- | sort | uniq -c | sort -rn | headrootopen.com
linux命令:history | cut -c8- | sort | uniq -c | sort -rn | head head | -rn sort | -c uniq | sort | -c8- cut | history history | cut -c8- | sort | uniq -c | sort -rn | headrootopen.com
2018-05-08 04:09:48

linux命令:history | awk '{print $2}' | sort | uniq -c | sort -rn | head head | -rn sort | -c uniq | sort | $2}' '{print awk | history history | awk '{print $2}' | sort | uniq -c | sort -rn | headrootopen.com
linux命令:history | awk '{print $2}' | sort | uniq -c | sort -rn | head head | -rn sort | -c uniq | sort | $2}' '{print awk | history history | awk '{print $2}' | sort | uniq -c | sort -rn | headrootopen.com
2018-02-26 22:23:48

linux命令:history | sed -e 's/^sudo //' | awk '{print $2}' | sort | uniq -c | sort -rn | head head | -rn sort | -c uniq | sort | $2}' '{print awk | //' 's/^sudo -e sed | history history | sed -e 's/^sudo //' | awk '{print $2}' | sort | uniq -c | sort -rn | headrootopen.com
linux命令:history | sed -e 's/^sudo //' | awk '{print $2}' | sort | uniq -c | sort -rn | head head | -rn sort | -c uniq | sort | $2}' '{print awk | //' 's/^sudo -e sed | history history | sed -e 's/^sudo //' | awk '{print $2}' | sort | uniq -c | sort -rn | headrootopen.com
2018-03-26 13:02:48

linux命令:history | awk '{$1=""; print $0}' > install_pkg.sh install_pkg.sh > $0}' print '{$1=""; awk | history history | awk '{$1=""; print $0}' > install_pkg.shrootopen.com
linux命令:history | awk '{$1=""; print $0}' > install_pkg.sh install_pkg.sh > $0}' print '{$1=""; awk | history history | awk '{$1=""; print $0}' > install_pkg.shrootopen.com
2017-12-30 16:55:48

linux命令:history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -nr | head head | -nr sort | -c uniq | sort | $1}' {FS="|"}{print 'BEGIN awk | $2}' '{print awk | history history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -nr | headrootopen.com
linux命令:history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -nr | head head | -nr sort | -c uniq | sort | $1}' {FS="|"}{print 'BEGIN awk | $2}' '{print awk | history history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -nr | headrootopen.com
2018-04-08 20:01:48

linux命令:history -a -a history history -arootopen.com
linux命令:history -a -a history history -arootopen.com
2018-02-08 19:36:48

linux命令:history > ~/history-save-$(date +%d-%m-%y-%T) +%d-%m-%y-%T) ~/history-save-$(date > history history > ~/history-save-$(date +%d-%m-%y-%T)rootopen.com
linux命令:history > ~/history-save-$(date +%d-%m-%y-%T) +%d-%m-%y-%T) ~/history-save-$(date > history history > ~/history-save-$(date +%d-%m-%y-%T)rootopen.com
2018-05-31 23:02:48

linux命令:history | perl -pe "~s/ *[0-9]+ *//" *//" *[0-9]+ "~s/ -pe perl | history history | perl -pe "~s/ *[0-9]+ *//"rootopen.com
linux命令:history | perl -pe "~s/ *[0-9]+ *//" *//" *[0-9]+ "~s/ -pe perl | history history | perl -pe "~s/ *[0-9]+ *//"rootopen.com
2018-03-29 12:26:48

linux命令:history -d $((HISTCMD-1)) && command_to_run command_to_run && $((HISTCMD-1)) -d history history -d $((HISTCMD-1)) && command_to_runrootopen.com
linux命令:history -d $((HISTCMD-1)) && command_to_run command_to_run && $((HISTCMD-1)) -d history history -d $((HISTCMD-1)) && command_to_runrootopen.com
2018-03-09 16:43:48

linux命令:history | awk '{if ($2 == "sudo") a[$3]++; else a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head head | -rn sort | i}}' " " a[i] a){print in a[$2]++}END{for(i else a[$3]++; "sudo") == ($2 '{if awk | history history | awk '{if ($2 == "sudo") a[$3]++; else a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | headrootopen.com
linux命令:history | awk '{if ($2 == "sudo") a[$3]++; else a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head head | -rn sort | i}}' " " a[i] a){print in a[$2]++}END{for(i else a[$3]++; "sudo") == ($2 '{if awk | history history | awk '{if ($2 == "sudo") a[$3]++; else a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | headrootopen.com
2018-04-28 13:41:48

linux命令:history | awk '{if ($2 == "sudo") a[$3]++; else a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head head | -rn sort | i}}' " " a[i] a){print in a[$2]++}END{for(i else a[$3]++; "sudo") == ($2 '{if awk | history history | awk '{if ($2 == "sudo") a[$3]++; else a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | headrootopen.com
linux命令:history | awk '{if ($2 == "sudo") a[$3]++; else a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head head | -rn sort | i}}' " " a[i] a){print in a[$2]++}END{for(i else a[$3]++; "sudo") == ($2 '{if awk | history history | awk '{if ($2 == "sudo") a[$3]++; else a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | headrootopen.com
2017-12-31 07:06:48

linux命令:history | tail -100 | grep cmd cmd grep | -100 tail | history history | tail -100 | grep cmdrootopen.com
linux命令:history | tail -100 | grep cmd cmd grep | -100 tail | history history | tail -100 | grep cmdrootopen.com
2018-03-02 03:26:48

linux命令:history | awk '{CMD[$4]++;count++;} END { for (a in CMD )print CMD[a] " " CMD[a]/count*100 "% " a }' | sort -nr | nl | column -t | head -n 10 10 -n head | -t column | nl | -nr sort | }' a " "% CMD[a]/count*100 " " CMD[a] )print CMD in (a for { END '{CMD[$4]++;count++;} awk | history history | awk '{CMD[$4]++;count++;} END { for (a in CMD )print CMD[a] " " CMD[a]/count*100 "% " a }' | sort -nr | nl | column -t | head -n 10rootopen.com
linux命令:history | awk '{CMD[$4]++;count++;} END { for (a in CMD )print CMD[a] " " CMD[a]/count*100 "% " a }' | sort -nr | nl | column -t | head -n 10 10 -n head | -t column | nl | -nr sort | }' a " "% CMD[a]/count*100 " " CMD[a] )print CMD in (a for { END '{CMD[$4]++;count++;} awk | history history | awk '{CMD[$4]++;count++;} END { for (a in CMD )print CMD[a] " " CMD[a]/count*100 "% " a }' | sort -nr | nl | column -t | head -n 10rootopen.com
2018-01-09 12:34:48

linux命令:history | awk '{$1="";print substr($0,2)}' substr($0,2)}' '{$1="";print awk | history history | awk '{$1="";print substr($0,2)}'rootopen.com
linux命令:history | awk '{$1="";print substr($0,2)}' substr($0,2)}' '{$1="";print awk | history history | awk '{$1="";print substr($0,2)}'rootopen.com
2018-06-01 07:51:48

linux命令:history |awk '{print $3}' |awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c |sort -rn |head -10 -10 |head -rn |sort -c $1}'|sort|uniq {print {FS="|"} 'BEGIN |awk $3}' '{print |awk history history |awk '{print $3}' |awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c |sort -rn |head -10rootopen.com
linux命令:history |awk '{print $3}' |awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c |sort -rn |head -10 -10 |head -rn |sort -c $1}'|sort|uniq {print {FS="|"} 'BEGIN |awk $3}' '{print |awk history history |awk '{print $3}' |awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c |sort -rn |head -10rootopen.com
2018-02-04 11:53:48

linux命令:history|awk '{print $2}'|sort|uniq -c|sort -rn|head -30|awk '!max{max=$1;}{r="";i=s=100*$1/max;while(i-->0)r=r"#";printf "%50s %5d %s %s",$2,$1,r,"\n";}' %s",$2,$1,r,"\n";}' %s %5d "%50s '!max{max=$1;}{r="";i=s=100*$1/max;while(i-->0)r=r"#";printf -30|awk -rn|head -c|sort $2}'|sort|uniq '{print history|awk history|awk '{print $2}'|sort|uniq -c|sort -rn|head -30|awk '!max{max=$1;}{r="";i=s=100*$1/max;while(i-->0)r=r"#";printf "%50s %5d %s %s",$2,$1,r,"\n";}'rootopen.com
linux命令:history|awk '{print $2}'|sort|uniq -c|sort -rn|head -30|awk '!max{max=$1;}{r="";i=s=100*$1/max;while(i-->0)r=r"#";printf "%50s %5d %s %s",$2,$1,r,"\n";}' %s",$2,$1,r,"\n";}' %s %5d "%50s '!max{max=$1;}{r="";i=s=100*$1/max;while(i-->0)r=r"#";printf -30|awk -rn|head -c|sort $2}'|sort|uniq '{print history|awk history|awk '{print $2}'|sort|uniq -c|sort -rn|head -30|awk '!max{max=$1;}{r="";i=s=100*$1/max;while(i-->0)r=r"#";printf "%50s %5d %s %s",$2,$1,r,"\n";}'rootopen.com
2018-04-30 14:45:48

linux命令:history -r -r history history -rrootopen.com
linux命令:history -r -r history history -rrootopen.com
2018-02-04 19:19:48

Linux的Bash命令行(A-Z排序)