Linux 学习重点记录之一

一. Linux 发行版本及其各版本之间的联系和区别

Linux 主要有三个主流派:slackware、debian、redhat. 参考下图:

发行版本:

slackware:SUSE Linux Enterprise Server (SLES) , OpenSuse桌面

debian: ubuntu,deepin(深度),mint    ==》Ubuntu 重点学习之一

redhat: RHEL: RedHat Enterprise Linux, 每18个月发行一个新版本   ==》收费版,企业使用

CentOS: Community Enterprise Operating System 兼容RHEL的格式  ==》centos 社区版免费使用,重点学习之一             

                中标麒麟:中标软件 国产

                 Fedora:每6个月发行一个新版本

Alpine: 一个面向安全的轻型 Linux 发行版。它不同于通常 Linux 发行版,Alpine 采用了 musllibc 和 busybox 以减小系统的体积和运行时资源消耗,但功能上比 busybox 又完善的多,只有5M左右大小  ==》Docker 学习或者可以下载测试使用

ArchLinux:轻量简洁,遵循K.I.S.S.原则( keep it simple and stupid ),Manjaro   ==》windows 系统支持可以安装使用

Gentoo:极致性能,不提供传统意义的安装程序,下载源代码在本机上编译安装软件

LFS:Linux From scratch 自制Linux,只是一个说明书  ==》出师后可以自己编写个性化文件,仅仅是文件说明书

Android:kernel+busybox(工具集)+java虚拟机

二.安装Centos 7.6 并创建账号

下面截图是具体安装centos 7.6 步骤并创建一个账号xiaotang。 有图有真相~


三.完成安装和登录后,更改配置文件,history 查看命令历史显示执行时间

[xiaotang@Centos7 ~]$ history

    1  whoami

    2  hostname -I

    3  TTY

    4  tty

    5  export HISTTIMEFORMAT="%F %T "

    6  history

[xiaotang@Centos7 ~]$ nano .bash_profile

[xiaotang@Centos7 ~]$ source .bash_profile

[xiaotang@Centos7 ~]$ history

    1  2020-11-25 14:12:51 whoami

    2  2020-11-25 14:13:25 hostname -I

    3  2020-11-25 14:13:37 TTY

    4  2020-11-25 14:13:42 tty

    5  2020-11-25 14:22:01  export HISTTIMEFORMAT="%F %T "

    6  2020-11-25 14:22:10 history

    7  2020-11-25 14:35:47 nano .bash_profile

    8  2020-11-25 14:36:41 source .bash_profile

    9  2020-11-25 14:36:51 history

四.Linux 哲学思想

一切皆是文件大道至简(包括硬件);

小型,单一用途的程序;

链接程序,共同完成复杂的任务;

避免令人困惑的用户界面;

配置数据存储在文本中。

五.常用命令的使用格式

COMMADN [OPTIONS...][ARGUMENTS...]

选项:用于启用或者关闭命令的某个或者某些功能

     长选项:GNU风格选项,--word 例如:--all,--human

     短选项:UNIX风格选项,-c 例如: -l, -h

     BSD风格选项:一个字母,例如a,使用相对较少

参数:命令的作用对象,比如:文件名,用户名等

[root@Centos7 ~]# echo \\

\

[root@Centos7 ~]# date -d "-3 day"

Sun Nov 22 15:38:42 CST 2020

[root@Centos7 ~]# ifconfig -a

ens33: flags=4163  mtu 1500

        inet 10.0.0.206  netmask 255.255.255.0  broadcast 10.0.0.255

        inet6 fe80::271b:c7db:3fde:c13b  prefixlen 64  scopeid 0x20

        ether 00:0c:29:b7:b7:dd  txqueuelen 1000  (Ethernet)

        RX packets 526220  bytes 782273882 (746.0 MiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 132575  bytes 8160248 (7.7 MiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536

        inet 127.0.0.1  netmask 255.0.0.0

        inet6 ::1  prefixlen 128  scopeid 0x10

        loop  txqueuelen 1000  (Local Loopback)

        RX packets 0  bytes 0 (0.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 0  bytes 0 (0.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099  mtu 1500

        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255

        ether 52:54:00:4a:f4:8d  txqueuelen 1000  (Ethernet)

        RX packets 0  bytes 0 (0.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 0  bytes 0 (0.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0-nic: flags=4098  mtu 1500

        ether 52:54:00:4a:f4:8d  txqueuelen 1000  (Ethernet)

        RX packets 0  bytes 0 (0.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 0  bytes 0 (0.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


[root@Centos7 ~]# screen -S txt

[screen is terminating]

[root@Centos7 ~]# ll -a

total 40

dr-xr-x---.  5 root root  244 Nov 25 14:34 .

dr-xr-xr-x. 18 root root  236 Nov 25 14:01 ..

-rw-------.  1 root root 1992 Nov 25 14:03 anaconda-ks.cfg

-rw-------.  1 root root  372 Nov 25 15:59 .bash_history

-rw-r--r--.  1 root root  18 Dec 29  2013 .bash_logout

-rw-r--r--.  1 root root  176 Dec 29  2013 .bash_profile

-rw-r--r--.  1 root root  32 Nov 25 14:33 bash_profile

-rw-r--r--.  1 root root  176 Dec 29  2013 .bashrc

drwx------.  4 root root  31 Nov 25 14:15 .cache

drwx------.  4 root root  30 Nov 25 14:15 .config

-rw-r--r--.  1 root root  100 Dec 29  2013 .cshrc

drwx------.  3 root root  25 Nov 25 14:10 .dbus

-rw-r--r--.  1 root root 2040 Nov 25 14:11 initial-setup-ks.cfg

-rw-r--r--.  1 root root  129 Dec 29  2013 .tcshrc

-rw-------.  1 root root  66 Nov 25 14:15 .Xauthority

你可能感兴趣的:(Linux 学习重点记录之一)