我通过history
2 cmake
3 cd /Applications/
4 open Cmake.app
5 open Cmake.app
6 sudo bash
7 Cmake.app/Contents/bin/cmake-gui
8 sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install
9 cmake
10 which cmake
我希望将结果汇总到:
cmake 2
open Cmake.app 2
cd /Applications/ 1
...
我应该使用什么命令行?
答案 0 :(得分:1)
请尝试一下:
$ history | cut -d ' ' -f 4- | sort | uniq -c | awk '{for (i = 2; i < NF; i++) {printf("%s ", $i)} print $NF " " $1}'