文件计数

count files

find . -type f | wc -l
ref: https://askubuntu.com/questions/34099/find-number-of-files-in-folder-and-sub-folders

count lines

git ls-files | xargs wc -l
Stick grep cpp | in there before the xargs to grab cpp info.
Use git ls-files -z | xargs -0 wc -l if you have files with spaces in the name.

Works in git bash (windows) too.
ref: https://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository

check folder size
du -hs /path/to/directory    # size of EACH folder
du -h | sort -h   # sort
sudo du -h --max-depth=1 /path/to/directory   # depth level

ref: https://askubuntu.com/questions/1224/how-do-i-determine-the-total-size-of-a-directory-folder-from-the-command-line

发布了26 篇原创文章 · 获赞 0 · 访问量 1086

猜你喜欢

转载自blog.csdn.net/qq_41212157/article/details/98985231