1. find
# find all executable files (exclude dir)
find . -executable -type f -ls
$ find . -executable -type f | xargs -r ls -al
# find all files and sort by size and get the first 30 (-h means 'human readable')
find . -type f -print0 | xargs -0 du -h | sort -rh | head -n 30
2. diff
diff -y file1 file2 # -y is more readable
# icdiff:分屏显示diff内容
icdiff file-{a, b} #file-a file-b
3. 有用的小工具
3.1 pm: 在bash/zsh中迅速切换目录
# 将你常去的目录添加到 pm 中,然后一条命令进行切换:
cd projects/awesome-project
pm add awesome-project
# pm list 查看一下现在添加了哪些
pm list
# pm go + 名字,迅速切换到该目录
pm go awesome-project
# pm remove + 名字,进行删除
3.2 ncdu:可视化的空间分析程序
# 一层层的du,一层层的cd, 太麻烦了
3.3 cppman:C++ 98/11/14 手册查询 for Linux/MacOS
cppman std::thread
3.4 递归搜索文件内容,可替代grep, ack
ag 'content to search'