I have this folder contiaining a lot of *.cpp and *.h files. I want to get a line count of all the files and display them to the screen in sorted order of line count.
I know wc -l *.h *.cpp
will display all the file names with line count, but not in sorted order.
Use wc -l *.h *.cpp | sort -n
wc -l *.h *.cpp | sort -n
. One job (sort), one tool ( sort
).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.