linux 基础操作(四)

cat 查看文件

[root@localhost tmp]# cat test.txt 
1
2
2
3
34
[root@localhost tmp]# cat test.txt -n
1    1
2    2
3    2
4    3
5    34

tac 查看文件

[root@localhost tmp]# tac test.txt

more 查看文件

在 more 查看文件时 h 命令可以查询可以使用的相关命令
568A227BD11640F3A241AFCE98017B8D.jpg

less 查看文件

B3632DE7CD1340788A3AD3325F520A65.jpg
CA4320246A9A4A238AFE26010BE124C2.jpg

tail 和 head

[root@localhost etc]# head yum.conf
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=3
[root@localhost etc]# tail yum.conf
# download the new metadata and "pay" for it by yum not having correct
# information.

nl 查看文件

[root@localhost etc]# nl yum.conf
     1    [main]
     2    cachedir=/var/cache/yum/$basearch/$releasever
     3    keepcache=0
     4    debuglevel=2
     5    logfile=/var/log/yum.log
     6    exactarch=1

显示机器的处理器架构

[root@localhost /]# arch
x86_64

显示机器的处理器架构

[root@localhost /]# uname -m
x86_64

显示正在使用的内核版本

[root@localhost /]# uname -r
3.10.0-327.el7.x86_64

显示硬件系统部件 - (SMBIOS / DMI)

[root@localhost /]# dmidecode -q
BIOS Information
    Vendor: innotek GmbH
    Version: VirtualBox
    Release Date: 12/01/2006
    Address: 0xE0000
    Runtime Size: 128 kB
    ROM Size: 128 kB
    Characteristics:
        ISA is supported
        PCI is supported
        Boot from CD is supported
        Selectable boot is supported
        8042 keyboard services are supported (int 9h)
        CGA/mono video services are supported (int 10h)
        ACPI is supported

System Information
    Manufacturer: innotek GmbH
    Product Name: VirtualBox
    Version: 1.2
    Serial Number: 0
    UUID: 492D7861-44F7-4BE4-8049-7906864C5DCB
    Wake-up Type: Power Switch
    SKU Number: Not Specified
    Family: Virtual Machine

Base Board Information
    Manufacturer: Oracle Corporation
    Product Name: VirtualBox
    Version: 1.2
    Serial Number: 0
    Asset Tag: Not Specified
    Features:
        Board is a hosting board
    Location In Chassis: Not Specified
    Type: Motherboard

Chassis Information
    Manufacturer: Oracle Corporation
    Type: Other
    Lock: Not Present
    Version: Not Specified
    Serial Number: Not Specified
    Asset Tag: Not Specified
    Boot-up State: Safe
    Power Supply State: Safe
    Thermal State: Safe
    Security Status: None

OEM Strings
    String 1: vboxVer_5.1.4
    String 2: vboxRev_110228

压缩文件

[root@localhost tmp]# ls
localTest.txt  table.txt  test  test.txt
[root@localhost tmp]# bzip2 test.txt
[root@localhost tmp]# ls
localTest.txt  table.txt  test  test.txt.bz2

解压文件

[root@localhost tmp]# ls
localTest.txt  table.txt  test  test.txt.bz2
[root@localhost tmp]# bunzip2 test.txt.bz2
[root@localhost tmp]# ls
localTest.txt  table.txt  test  test.txt

查看日历

[root@localhost /]# cal
      June 2017     
Su Mo Tu We Th Fr Sa
             1  2  3
 4  5  6  7  8  9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30
[root@localhost /]# cal 2017
                               2017                               

       January               February                 March       
Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa
 1  2  3  4  5  6  7             1  2  3  4             1  2  3  4
 8  9 10 11 12 13 14    5  6  7  8  9 10 11    5  6  7  8  9 10 11
15 16 17 18 19 20 21   12 13 14 15 16 17 18   12 13 14 15 16 17 18
22 23 24 25 26 27 28   19 20 21 22 23 24 25   19 20 21 22 23 24 25
29 30 31               26 27 28               26 27 28 29 30 31

        April                   May                   June        
Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa
                   1       1  2  3  4  5  6                1  2  3
 2  3  4  5  6  7  8    7  8  9 10 11 12 13    4  5  6  7  8  9 10
 9 10 11 12 13 14 15   14 15 16 17 18 19 20   11 12 13 14 15 16 17
16 17 18 19 20 21 22   21 22 23 24 25 26 27   18 19 20 21 22 23 24
23 24 25 26 27 28 29   28 29 30 31            25 26 27 28 29 30
30
        July                  August                September     
Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa
                   1          1  2  3  4  5                   1  2
 2  3  4  5  6  7  8    6  7  8  9 10 11 12    3  4  5  6  7  8  9
 9 10 11 12 13 14 15   13 14 15 16 17 18 19   10 11 12 13 14 15 16
16 17 18 19 20 21 22   20 21 22 23 24 25 26   17 18 19 20 21 22 23
23 24 25 26 27 28 29   27 28 29 30 31         24 25 26 27 28 29 30
30 31
       October               November               December      
Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa
 1  2  3  4  5  6  7             1  2  3  4                   1  2
 8  9 10 11 12 13 14    5  6  7  8  9 10 11    3  4  5  6  7  8  9
15 16 17 18 19 20 21   12 13 14 15 16 17 18   10 11 12 13 14 15 16
22 23 24 25 26 27 28   19 20 21 22 23 24 25   17 18 19 20 21 22 23
29 30 31               26 27 28 29 30         24 25 26 27 28 29 30
                                              31
[root@localhost /]# cal 9 2017
   September 2017   
Su Mo Tu We Th Fr Sa
                1  2
 3  4  5  6  7  8  9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

clear 清屏

[root@localhost /]# cal 9 2017
   September 2017   
Su Mo Tu We Th Fr Sa
                1  2
 3  4  5  6  7  8  9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

[root@localhost /]# clear

查看 linux 内核版本

[root@localhost ~]# cat /proc/version
Linux version 3.10.0-957.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Thu Nov 8 23:39:32 UTC 2018

centos 上挂载 windows 共享目录

[root@localhost tmp]# mount -t cifs -o username=hp,password=123456linux //192.168.219.230/linux /mnt
mount error(5): Input/output error
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
[root@localhost etc]# mount -t cifs -o username=hp,password=123456linux,vers=3.0  \\\\192.168.219.230\\linux /mnt

上一篇 linux 基础操作(三)
下一篇 linux 基础操作(五)