Showing posts with label terminal. Show all posts
Showing posts with label terminal. Show all posts

Wednesday, November 30, 2016

How to print the epoch using date command

To print epoch - The seconds that has passed since 1970-01-01 00:00:00 UTC, run the following command,

date +"%s" 1480572641

Here %s tells date to print the epoch.



Tested on: CentOS 7, Debian 8, Ubuntu 16.04

Monday, November 14, 2016

Display Information About the CPU and Processing Unit on Linux

To display information about the CPU architecture of a Linux system lscpu command is used.

The man page of lscpu says,

lscpu gathers CPU architecture information from sysfs and /proc/cpuinfo. The command output can be optimized for parsing or for easy readability by humans. The information includes, for example, the number of CPUs, threads, cores, sockets, and Non-Uniform Memory Access (NUMA) nodes. There is also information about the CPU caches and cache sharing, family, model, bogoMIPS, byte order, and stepping.

Options that result in an output table have a list argument. Use this argument to customize the command output. Specify a comma-separated list of column labels to limit the output table to only the specified columns, arranged in the specified order. See COLUMNS for a list of valid column labels. The column labels are not case sensitive.

Not all columns are supported on all architectures. If an unsupported column is specified, lscpu prints the column but does not provide any data for it.


lscpu command is very easy to use. To use lscpu, just run "lscpu" on the terminal.

lscpu

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                1
On-line CPU(s) list:   0
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 78
Model name:            Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
Stepping:              3
CPU MHz:               2399.996
BogoMIPS:              4799.99
Hypervisor vendor:     KVM
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              3072K
NUMA node0 CPU(s):     0
Flags:                 fpu vme de pse tsc msr pae mce cx8
apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr 
sse sse2 syscall nx rdtscp lm constant_tsc rep_good 
nopl xtopology nonstop_tsc pni pclmulqdq monitor ssse3 
cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave 
avx rdrand hypervisor lahf_lm abm 3dnowprefetch rdseed clflushopt

Thursday, October 13, 2016

See The Users that have Running Processes on Linux System

Hi,

Today I am gonna write about how to see the users on your Linux system that are running some processes.

I have a YouTube video about this post. Check it out if you wish.

YouTube : See The Users that have Running Processes on Linux System



The command is,

sudo ps aux | awk '{print $1}' | sort | uniq | grep -v USER

Explanation

sudo ps aux is used to list the running processes of the system.

awk '{print $1}' is used to print only the first column from the output of sudo ps aux

sort is used to sort the output.

uniq is used to get only the unique lines.

grep -v USER is used to remove the line that contains the field name USER.

Thank you for the visit. :-)