get
Get information about the processor – Linux
Gather all information about your processor: cat /proc/cpuinfo Get the number of processors on your system: cat /proc/cpuinfo | grep processor | wc -l Get the model of your processor/s: cat /proc/cpuinfo | grep -m 1 "model name"
Extract all printable characters from binary files
Strings is a very useful command that can extract all printable characters from binary files. Example: strings /usr/sbin/visudo | more /lib64/ld-linux-x86-64.so.2 __gmon_start__ libc.so.6 __printf_chk setgrent fnmatch readdir execv _IO_putc setlocale fopen strsignal strncmp optind strrchr __progname dcgettext getpwuid closedir getgrgid getdomainname fork futimes –More–
Get Field Name and Type of Database Table
Today we will see how we can retrieve table’s columns’ names and types. USE mydatabase GO SELECT column_name, data_type FROM information_schema.COLUMNS WHERE TABLE_NAME = ‘mytable’;
How do I find out the MAC address of my Linux system?
I know that is something common but people keep questioning me about how to get the ethernet mac address on their linux system. So, here it is. Issue the following command: ifconfig eth0 | grep HWaddr
Get Apache version in Ubuntu
To get Apache version open a terminal and issue the following command: apache2 -v or /usr/sbin/apache2 -v You will get a response similar to this: Server version: Apache/2.2.20 (Ubuntu) Server built: Feb 14 2012 16:35:35
Retrieve useful information from Apache logs
Common locations where you can find Apache logs are /var/log/apache2 and /var/log/httpd/. You can extract valuable information from your apache logs. Here are some useful examples! Extract unique IP addresses: cat /var/log/apache2/access.log | awk ‘{print $1}’ | sort | uniq Extract unique IP addresses with datetime stamp: cat /var/log/apache2/access.log | awk ‘{print $1 " [...]