Get just the number of processes on your Linux machine.

This command will print the number of running processes on a Linux system. 4.4 Tue Oct 30 jason@Yog-Sothoth 0: $ ps aux | wc -l 2554.4 Tue Oct 30 jason@Yog-Sothoth 0: $ ps aux | wc -l 255 Here is a nice alternative that will work on Ubuntu. The landscape-common…

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

Count how many times users have successfully logged into your Linux machine.

This command will display a count of successful logins to your Linux machine. jason-H55-USB3% grep ‘session opened’ /var/log/auth.log | wc -l 67jason-H55-USB3% grep ‘session opened’ /var/log/auth.log | wc -l 67 This will display a count of failed login attempts to your Linux machine. jason-H55-USB3% grep ‘FAILED LOGIN’ /var/log/auth.log | wc…

Read More