Finding the number of processor units

$nproc 
2
$nproc --ignore=1
1
$grep -c ^processor /proc/cpuinfo
2
$cat /proc/cpuinfo | awk '/^processor/{print $3=$3+1}' | tail -1
2
$cat /proc/cpuinfo | awk '/^processor/{print $3}' 
0
1
$lscpu | grep CPU
CPU op-mode(s):        32-bit, 64-bit
CPU(s):                2
On-line CPU(s) list:   0,1
CPU family:            21
CPU MHz:               2800.000
CPU max MHz:           3000.0000
CPU min MHz:           1400.0000
NUMA node0 CPU(s):     0,1
$lscpu | grep "CPU(s)"
CPU(s):                2
On-line CPU(s) list:   0,1
NUMA node0 CPU(s):     0,1
$lscpu | grep "CPU(s):"
CPU(s):                2
NUMA node0 CPU(s):     0,1
$lscpu | grep ^"CPU(s):"
CPU(s):                2
$lscpu | awk 'FNR == 4 {print $2}'
2
$

finding the current state of a network cable

$sudo cat /sys/class/net/eth0/speed 
100
$sudo cat /sys/class/net/eth0/ca
carrier          carrier_changes  
$sudo cat /sys/class/net/eth0/carrier
1
$sudo cat /sys/class/net/eth0/carrier_changes 
2
$sudo cat /sys/class/net/eth0/operstate 
up
$sudo ethtool eth0
Settings for eth0:
	Supported ports: [ TP MII ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Half 1000baseT/Full 
	Supported pause frame use: No
	Supports auto-negotiation: Yes
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Half 1000baseT/Full 
	Advertised pause frame use: Symmetric Receive-only
	Advertised auto-negotiation: Yes
	Link partner advertised link modes:  10baseT/Half 10baseT/Full 
	                                     100baseT/Half 100baseT/Full 
	Link partner advertised pause frame use: Symmetric Receive-only
	Link partner advertised auto-negotiation: Yes
	Speed: 100Mb/s
	Duplex: Full
	Port: MII
	PHYAD: 0
	Transceiver: internal
	Auto-negotiation: on
	Supports Wake-on: pumbg
	Wake-on: g
	Current message level: 0x00000033 (51)
			       drv probe ifdown ifup
	Link detected: yes
$

http://www.ostechnix.com/how-to-find-out-the-connected-
state-of-a-network-cable-in-linux/
times command data structure tms exposed

times() stores the current process times in
the struct tms that buf points to.  
The struct tms is as defined in <sys/times.h>:

struct tms {
   clock_t tms_utime;  /* user time */
   clock_t tms_stime;  /* system time */
   clock_t tms_cutime; /* user time of children */
   clock_t tms_cstime; /* system time of children */
           };
httping with sending of username and password and flood ping

$httping -U www.beautifulwork.org
No URL/host to ping given

$httping -U http://www.beautifulwork.org
No URL/host to ping given

$httping  http://www.beautifulwork.org
PING www.beautifulwork.org:80 (/):
connected to 89.36.208.169:80 (224 bytes), seq=0 time=455.10 ms 
connected to 89.36.208.169:80 (224 bytes), seq=1 time=458.34 ms 
connected to 89.36.208.169:80 (224 bytes), seq=2 time=447.45 ms 
^CGot signal 2
--- http://www.beautifulwork.org/ ping statistics ---
4 connects, 3 ok, 0.00% failed, time 4418ms
round-trip min/avg/max = 447.5/453.6/458.3 ms
$httping -U anonymous http://www.beautifulwork.org
$httping -U anonymous http://www.beautifulwork.org
PING www.beautifulwork.org:80 (/):
connected to 89.36.208.169:80 (224 bytes), seq=0 time=453.33 ms 
connected to 89.36.208.169:80 (224 bytes), seq=1 time=459.89 ms 
connected to 89.36.208.169:80 (224 bytes), seq=2 time=451.59 ms 
connected to 89.36.208.169:80 (224 bytes), seq=3 time=455.54 ms 
connected to 89.36.208.169:80 (224 bytes), seq=4 time=448.82 ms 
^CGot signal 2
--- http://www.beautifulwork.org/ ping statistics ---
5 connects, 5 ok, 0.00% failed, time 6948ms
round-trip min/avg/max = 448.8/453.8/459.9 ms
$httping -U userfoo http://www.beautifulwork.org
PING www.beautifulwork.org:80 (/):
connected to 89.36.208.169:80 (224 bytes), seq=0 time=449.55 ms 
connected to 89.36.208.169:80 (224 bytes), seq=1 time=462.89 ms 
connected to 89.36.208.169:80 (224 bytes), seq=2 time=446.10 ms 
connected to 89.36.208.169:80 (224 bytes), seq=3 time=445.94 ms 
^CGot signal 2
--- http://www.beautifulwork.org/ ping statistics ---
4 connects, 4 ok, 0.00% failed, time 5721ms
round-trip min/avg/max = 445.9/451.1/462.9 ms
$httping -U userfoo -P withfoo http://www.beautifulwork.org
PING www.beautifulwork.org:80 (/):
connected to 89.36.208.169:80 (224 bytes), seq=0 time=459.03 ms 
connected to 89.36.208.169:80 (224 bytes), seq=1 time=445.85 ms 
connected to 89.36.208.169:80 (224 bytes), seq=2 time=489.32 ms 
connected to 89.36.208.169:80 (224 bytes), seq=3 time=461.37 ms 
^CGot signal 2
--- http://www.beautifulwork.org/ ping statistics ---
4 connects, 4 ok, 0.00% failed, time 5614ms
round-trip min/avg/max = 445.8/463.9/489.3 ms



$httping -f http://www.beautifulwork.org
PING www.beautifulwork.org:80 (/):
connected to 89.36.208.169:80 (224 bytes), seq=0 time=458.52 ms 
connected to 89.36.208.169:80 (224 bytes), seq=1 time=447.23 ms 
connected to 89.36.208.169:80 (224 bytes), seq=2 time=442.29 ms 
connected to 89.36.208.169:80 (224 bytes), seq=3 time=444.83 ms 
connected to 89.36.208.169:80 (224 bytes), seq=4 time=456.58 ms 
connected to 89.36.208.169:80 (224 bytes), seq=5 time=446.09 ms 
connected to 89.36.208.169:80 (224 bytes), seq=6 time=447.35 ms 
^CGot signal 2

--- http://www.beautifulwork.org/ ping statistics ---
8 connects, 7 ok, 12.50% failed, time 3580ms
round-trip min/avg/max = 442.3/449.0/458.5 ms
$

anonymous pages and memory from /proc/meminfo

$cat /proc/meminfo
MemTotal:        3495924 kB
MemFree:         1465276 kB
MemAvailable:    2353604 kB
Buffers:          126008 kB
Cached:           962924 kB
SwapCached:            0 kB
Active:          1330576 kB
Inactive:         452848 kB
Active(anon):     695532 kB
Inactive(anon):    29420 kB
Active(file):     635044 kB
Inactive(file):   423428 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       7259132 kB
SwapFree:        7259132 kB
Dirty:               232 kB
Writeback:             0 kB

AnonPages: 694488 kB

Mapped: 291508 kB Shmem: 30464 kB Slab: 97912 kB SReclaimable: 65988 kB SUnreclaim: 31924 kB KernelStack: 7808 kB PageTables: 30060 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 9007092 kB Committed_AS: 3508024 kB VmallocTotal: 34359738367 kB VmallocUsed: 0 kB VmallocChunk: 0 kB HardwareCorrupted: 0 kB AnonHugePages: 0 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB DirectMap4k: 198692 kB DirectMap2M: 3432448 kB DirectMap1G: 0 kB $ https://blogs.oracle.com/cwb/entry/so_what_the_heck_is
sample session with “shopt -s cdspell” with Bash

$shopt -s 
checkwinsize   	on
cmdhist        	on
complete_fullquote	on
expand_aliases 	on
extglob        	on
extquote       	on
force_fignore  	on
histappend     	on
interactive_comments	on
progcomp       	on
promptvars     	on
sourcepath     	on
$shopt -s cdspell
$shopt -s 
cdspell        	on
checkwinsize   	on
cmdhist        	on
complete_fullquote	on
expand_aliases 	on
extglob        	on
extquote       	on
force_fignore  	on
histappend     	on
interactive_comments	on
progcomp       	on
promptvars     	on
sourcepath     	on
$shopt -s gnu
bash: shopt: gnu: invalid shell option name
$cd /etc/ap
apache2/    apm/        apparmor/   apparmor.d/ apport/     apt/        
$cd /etc/apache3
/etc/apache2
$pwd
/etc/apache2
$


http://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html
appending file using “paste” command hack

$cat a.txt 
hello
$cat b.txt 
killo
$ls
1  a.txt  b.txt  l.txt  trueangle  u.txt
$cat u.txt 
UPPERCASE
$cat l.txt 
uppercase
$cat a.txt >> b.txt >> l.txt >> u.txt 
$cat u.txt 
UPPERCASE
hello
$cat a.txt 
hello
$cat 
1          a.txt      b.txt      l.txt      trueangle/ u.txt      
$cat l.txt 
uppercase
$cat a.txt 
hello
$cat a.txt >> b.txt 
$cat b.txt 
killo
hello
$cat l.txt >> u.txt 
$cat u.txt 
UPPERCASE
hello
uppercase
$paste b.txt u.txt > final.txt
$cat final.txt 
killo	UPPERCASE
hello	hello
	uppercase
$sort -t: -k1 final.txt 
hello	hello
killo	UPPERCASE
	uppercase
$