
本文共 6071 字,大约阅读时间需要 20 分钟。
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������
������������������������������������������������������������������������������������������
1. ������������������������������������
���������������������������������������������������������������������������������������������������.h
���������������������������������������������������������������������������������������������������������������������������������������������������������
2. ������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������
��������������������������� find
��������� exec
������������������������������������������������������������������������������������������
find ./ -name '*.h' -exec dirname {} ;
���������������������������������.h
��������������� dirname
������������������������������������������������������������������������������������������������������
������������������������������������������������ exec
������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������)./ -name '*.h'
_���������������������������������������������������
������������������������������������������������������������������������������������������������������������������������ exec
���������������������������������������������������������������������1000������������������������������������1000������������������������������������������������������������������������������������������������������������������
���������������������
��������������������������������������������������������������������������������� find
������������������������������������������������������������
������������������find���������������������
��������� Unix/Linux ������������������������������������������������������������������������������ find
��������� xargs
���������������������������������������
find ./ -name '*.h' | xargs dirname | sort -u > inc_file
���������������������
find
��������������������������������������������������������������������������� .h
������������
xargs dirname
������������������������������������ dirname
���������������������������������������������
sort -u
���������������������������������������������������������������
> inc_file
������������������������������������ inc_file
���������������������
������������������������������������|
������������������������������������������ exec
������������������������������������������������������ exec
���������xargs
������������������������������������������������������������������
CPU ���������������������������������������������������������������������������������shellBufferSize ������������������������������������
������������������������ xargs
���������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������
��������������������������������������������������������������������������������������������������� matches below ���������
sed 's/\/\(.*\)/-I"\/1"/g' inc_file
��������������������� inc_file
������������������������ sed
������������������������������������������������������������������������������������������������ ./src ������������ file.h
������������������������������������������������ -I"/project/path/src"
���������������
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������
������������������������������������������������������������������������
# ������������������find ./ -name '*.h' -exec dirname {} ; | time AND measure command time...# ������������������find ./ -name '*.h' | xargs dirname | sort -u & time
���������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������
CPU ������������������������������������ CPU ������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������
���������������������������������
���������������������������������������������������������
��������������������������������������������������������������������������������������������� find
��������� depth
������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
发表评论
最新留言
关于作者
