CentOS 8 | 学习笔记之基本命令一

2020-04-21  本文已影响0人  三日之城

1.查看系统信息

[root@CJtest network-scripts]# cat /etc/centos-release

CentOS Linux release 8.1.1911 (Core)

[root@CJtest network-scripts]#

[root@CJtest network-scripts]# lsb_release -a

LSB Version: :core-4.1-amd64:core-4.1-noarch

Distributor ID: CentOS

Description: CentOS Linux release 8.1.1911 (Core)

Release: 8.1.1911

Codename: Core

[root@CJtest network-scripts]#

2.查看硬盘,网卡

[root@CJtest network-scripts]# lsblk

NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT

sda            8:0    0  50G  0 disk

├─sda1          8:1    0  512M  0 part /boot

├─sda2          8:2    0  32G  0 part

│ ├─cl-root  253:0    0  30G  0 lvm  /

│ └─cl-swap  253:1    0    2G  0 lvm  [SWAP]

└─sda3          8:3    0 17.5G  0 part

  └─data-data 253:2    0 17.5G  0 lvm  /data

sr0            11:0    1    7G  0 rom

[root@CJtest network-scripts]# mii-tool ens33

ens33: negotiated 1000baseT-FD flow-control, link ok

[root@CJtest network-scripts]#

3.查看shell

[root@CJtest ~]# cat /etc/shells

/bin/sh

/bin/bash

/usr/bin/sh

/usr/bin/bash

查看当前使用的shell

[root@CJtest ~]# echo $SHELL

/bin/bash

[root@CJtest ~]# ls -l

total 8

-rw-------. 1 root root 1657 Apr 20  2020 anaconda-ks.cfg

-rw-r--r--. 1 root root 1982 Apr 20  2020 initial-setup-ks.cfg

[root@CJtest ~]# > test

[root@CJtest ~]# ls -l

total 8

-rw-------. 1 root root 1657 Apr 20  2020 anaconda-ks.cfg

-rw-r--r--. 1 root root 1982 Apr 20  2020 initial-setup-ks.cfg

-rw-r--r--. 1 root root    0 Apr 20 04:24 test

[root@CJtest ~]#

4.更改PS1格式

[root@CJtest ~]# echo $PS1

[\u@\h \W]\$

[root@CJtest ~]#

For example:

PS1="\[\e[1;5;41;33m\][\u@\h \W]\$\[\e[0m\]"

利用nano编辑文件,把PS1保存在/etc/profile.d下

[root@CJtest ~]$nano env.sh

5.修改登录系统后的提示信息

[root@CJtest ~]$cat /etc/motd

[root@CJtest ~]$nano /etc/motd

[chaijing@CJtest ~]$cat /etc/motd

ようこそ!

[chaijing@CJtest ~]$

ChaideMacBook-Air:~ chaijing$ ssh chaijing@192.168.1.249

chaijing@192.168.1.249's password:

ようこそ!

Activate the web console with: systemctl enable --now cockpit.socket

Last login: Mon Apr 20 03:45:14 2020 from 192.168.1.233

[chaijing@CJtest ~]$

上一篇下一篇

猜你喜欢

热点阅读