How to get extra context around search results from grep.

Using grep to find text strings is very useful. This may also be used to view extra text around the matches to get extra context. Use grep like this. grep -R -A 10 -B 10 ‘command arguments’ * 2>/dev/nullgrep -R -A 10 -B 10 ‘command arguments’ * 2>/dev/null This returns…

Read More

Count the actual lines of code in your C or C++ project.

This is how to actually count the lines of code in your C project on Linux. Some people advocate using wc -l, but that would not suit our purposes. The cloc utility is able to do this and more. Firstly, install this utility. sudo apt install clocsudo apt install cloc…

Read More