Using the sysctl command on Linux to return hardware information. And some other related commands.

The sysctl command on Linux may be used to return information about your installed hardware; as well as virtual memory information. Below is an example looking at virtual memory information. zsh 7 % sysctl -a | grep vm sysctl: permission denied on key ‘kernel.cad_pid’ sysctl: permission denied on key ‘kernel.usermodehelper.bset’ sysctl: permission denied on key … Read more

Sample C programming code. How to get input from the console.

This is a sample C program showing how to define a function as well as accepting input from the command-line. Hopefully this is useful for someone who is writing a console application for Linux or UNIX. #include <stdio.h> #include <string.h>   int main(int argc, char **argv) {   char *name; name = argv[1];   if … Read more