Linux tips – I

1. To discard empty lines printed by a command or program you are running on a Linux terminal:

your_program |grep -v '^$';

2. To execute a single command on a remote machine, without logging into that machine:

ssh -l user_name machine_name_or_IP "command to run"
Example: ssh -l mutlu "df -h"

3. To check your Linux distribution name and version (not the kernel version):

cat /etc/issue


cat /etc/*-release


lsb_release -a

4. To get the number of CPUs on your machine:

cat /proc/cpuinfo |grep MHz|wc -l

5. To get CPU speed:

cat /proc/cpuinfo |grep MHz|head -1