linux system administration - Chapter 2 Linux help Linux server command and view basic information

linux system administration - Chapter 2 Linux help Linux server command and view basic information

Outline

In fact, Linux command syntax is not very complex, they are very similar with English grammar. Syntax is as follows:

Options command parameters command [options] [arguments]

Between each use of a command line or a plurality of separated spaces, in square brackets are optional part.

Command: tell the Linux operating system what to do

Option: Description Run commands start with -

Parameter: Description of what the command influence (such as a file or directory)

Two help commands

2.1 whatis

Because Linux is a lot of commands, the user can not remember all the commands of usage. We need the help of Linux help commands. Whatis, displays a brief description of the query command.

[root@RHCE7 yum.repos.d]# whatis who

who (1) - display a user has logged on

who (1p)             - display who is on the system

[root@RHCE7 yum.repos.d]# who

root     :0           2019-07-18 22:10 (:0)

root     pts/0        2019-07-18 22:10 (192.168.247.1)

2.2 -–help

--help is a brief description and a list of options on the command

[root@RHCE7 yum.repos.d]# uname --help

Usage: uname [option] ...

Outputs a set of system information. If you do not follow the option is considered only additional -s option.

 

  -a, --all output all the information in the following order. And wherein if -p

                                -I agnostic detection results were omitted:

  -s, --kernel-name the name of the kernel output

  -n, the host name on the network node output --nodename

  -r, --kernel-release output kernel release number

  -v, --kernel-version output version of the kernel

  -m, --machine output hardware architecture of the host name

  -p, --processor output processor type or "unknown"

  -i, --hardware-platform output hardware platform or "unknown"

  -o, --operating-system output operating system name

      --help display this help and exit

      --version display version information and exit

2.3 man to help man the most complete command

Man is the most complete Linux help commands, use the up and down arrow keys to view the line, use pgup, pgdn, blank pages to be viewed positively. Use / keys to search for keywords, N key check to find. Q key is to leave.

 

NAME

       uname - display information output system

Overview uname [OPTION] ...

description

       The system displays the corresponding information is not specified options, with -s.

       -a, --all display all information 

2.3.1 man -k

 Man -k character is to look at the query is ambiguous query What command

[root@RHCE7 yum.repos.d]# man -k who

who (1) - display a user has logged on

at.allow (5)         - determine who can submit jobs via at or batch

at.deny (5)          - determine who can submit jobs via at or batch

btrfs-filesystem (8) - command group of btrfs that usually work on the whole ...

ipsec_newhostkey (8) - generate a new raw RSA authentication key for a host

ipsec_showhostkey (8) - show host's authentication key

w (1)                - Show who is logged on and what they are doing.

who (1p)             - display who is on the system

whoami (1)           - print effective userid

2.4 linux file Help

In addition to the above method to get help described, Linux also offers numerous documentation in / usr / share / doc directory.

[root@RHCE7 /]# cat /usr/share/selinux/targeted/base.lst

Three basic conditions to see Linux

, Proc file system is a pseudo file system, it only exists among memory, external memory without taking up space. It is the operating system kernel to access the data in a manner that provides an interface to the file system. Users and applications can be obtained by the information system proc, certain parameters may be changed and the kernel. Due to information systems, such as the process is dynamically changing, so the user or application reads the proc file, proc file system is a dynamic system kernel is read out from the required information and submit.

View Linux 3.1 operating system and the computer name

[root@RHCE7 /]# cat /etc/redhat-release

Red Hat Enterprise Linux Server release 7.4 (Maipo)

[root@RHCE7 /]# uname -a

Linux RHCE7.0 3.10.0-693.el7.x86_64 # 1 SMP Thu Jul 6 19:56:57 EDT 2017 x86_64 x86_64 x86_64 GNU / Linux.

[root@RHCE7 /]#  cat /proc/version

Linux version 3.10.0-693.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) ) #1 SMP Thu Jul 6 19:56:57 EDT 2017

[root@RHCE7 /]#  hostname

RHCE7.0

3.2 View Machine Model

[root@RHCE7 /]#  dmidecode | grep "Product Name"

        Product Name: VMware Virtual Platform

        Product Name: 440BX Desktop Reference Platform

3.3 CPU View

[root@RHCE7 /]# cat /proc/cpuinfo |grep name 

model name      : Intel(R) Core(TM) i5-7400 CPU @ 3.00GHz

model name      : Intel(R) Core(TM) i5-7400 CPU @ 3.00GHz

3.4 View Memory

[root@RHCE7 /]# free –m

[root@RHCE7 /]# cat /proc/meminfo

3.5 Check the hard disk

[root@RHCE7 /]# df –h

[root@RHCE7 /]# fdisk -l

Disk /dev/sda:128.8 GB, 128849018880 bytes, sectors 251 658 240

3.6 View board model

[root@RHCE7 /]# dmidecode | grep -i 'serial number'

        Serial Number: VMware-56 4d a0 c6 77 fb e5 d0-0b d9 fa 0a ff 7c 82 80

3.7 View linux environment variables

[root@RHCE7 /]# env

Published 37 original articles · won praise 0 · Views 2412

Guess you like

Origin blog.csdn.net/syjhct/article/details/97974991