CentOS is build from the Red hat Enterprise Distribution. which is more stable than any other Linux Distributions because of its package updates were not too often which makes this OS standout from the que. Core version of this OS is very convenient compared to GUI version to acts as Server.
uname:
Uname command is used to find the version of Linux and the OS Architecture x86 or x64 bit
[root@10 ~]# uname -a
Linux 10.0.2.15 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
uname -a provides the all details of the OS.
[root@10 ~]# uname --help
Usage: uname [OPTION]...
Print certain system information. With no OPTION, same as -s.
-a, --all print all information, in the following order,
except omit -p and -i if unknown:
-s, --kernel-name print the kernel name
-n, --nodename print the network node hostname
-r, --kernel-release print the kernel release
-v, --kernel-version print the kernel version
-m, --machine print the machine hardware name
-p, --processor print the processor type or "unknown"
-i, --hardware-platform print the hardware platform or "unknown"
-o, --operating-system print the operating system
--help display this help and exit
--version output version information and exit
GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
For complete documentation, run: info coreutils 'uname invocation'
uname --help for additional arguments
top:
Top command shows the list of process running in background.
[root@10 ~]# top
top - 08:44:45 up 10 min, 1 user, load average: 0.00, 0.15, 0.19
Tasks: 85 total, 2 running, 83 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.3 us, 2.0 sy, 0.0 ni, 97.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 500780 total, 162304 free, 84752 used, 253724 buff/cache
KiB Swap: 1048572 total, 1048572 free, 0 used. 367316 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
22 root 20 0 0 0 0 S 1.7 0.0 0:08.83 kworker/0:1
9824 root 20 0 148184 2028 1452 R 0.7 0.4 0:00.15 top
11 root 20 0 0 0 0 R 0.3 0.0 0:00.62 rcuos/0
1 root 20 0 46380 6772 4028 S 0.0 1.4 0:03.13 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
3 root 20 0 0 0 0 S 0.0 0.0 0:00.82 ksoftirqd/0
5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H
6 root 20 0 0 0 0 S 0.0 0.0 0:00.15 kworker/u2:0
7 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh
9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcuob/0
10 root 20 0 0 0 0 S 0.0 0.0 0:02.54 rcu_sched
12 root rt 0 0 0 0 S 0.0 0.0 0:00.30 watchdog/0
13 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 khelper
14 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kdevtmpfs
15 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 netns
16 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 perf
17 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 writeback
18 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kintegrityd
19 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset
20 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kblockd
21 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 md
26 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khungtaskd
27 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kswapd0
28 root 25 5 0 0 0 S 0.0 0.0 0:00.00 ksmd
29 root 20 0 0 0 0 S 0.0 0.0 0:00.00 fsnotify_mark
30 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 crypto
38 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kthrotld
39 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kworker/u2:1
40 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kmpath_rdacd
41 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kpsmoused
42 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ipv6_addrconf
62 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 deferwq
93 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kauditd
258 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ata_sff
261 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 events_power_ef
276 root 20 0 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_0
free:
Free command is used to check the Memory Status of the server including RAM and Swap memory.
[root@10 ~]# free -m
total used free shared buff/cache available
Mem: 489 84 150 14 254 356
Swap: 1023 0 1023
hostname:
Hostname command is to check the current server name
[root@10 ~]# hostname
10.0.2.15
ip addr:
This command is to view the IP Address assigned to the server.
[root@10 ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:86:d9:d7 brd ff:ff:ff:ff:ff:ff
inet 192.168.43.128/24 brd 192.168.43.255 scope global dynamic enp0s3
valid_lft 2806sec preferred_lft 2806sec
inet6 fe80::a00:27ff:fe86:d9d7/64 scope link
valid_lft forever preferred_lft forever
vi Editor:
vi editor is often used by most pros for file editing in core edition.
[root@10 ~]# vi /tmp/test.txt
test
~
~
~
~
~
~
~
"/tmp/test.txt" 1L, 5C
Commands to use:
:w - Save the edit
:q - Exit file
:q! - Exit without saving changes
:wq or :x - Save and exit the changes
cat:
cat is used to print the data available inside a file
[root@10 ~]# cat /tmp/test.txt
test
[root@10 ~]# cat /etc/*release
CentOS Linux release 7.2.1511 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
CentOS Linux release 7.2.1511 (Core)
CentOS Linux release 7.2.1511 (Core)
cat /etc/*release will print all possible files ends with name ‘release’ will be printed from the /etc/ directory
