一、安装软件
yum
基于 RPM
包的管理器,用于自动化安装配置Linux软件,并且可以自动解决依赖问题。
yum [-y] [install | remove | rearch] 软件名称
- -y,自动确认,无需手动确认安装或卸载过程
- install : 安装
- remove: 卸载
- search: 搜索
注意:
示例:
yum search wget
yum install wget
apt-ubuntu
二、操作软件
1. systemctl
// 查看防火墙状态
systemctl status firewalld
firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since 四 2023-07-20 04:13:14 PDT; 15h ago
Docs: man:firewalld(1)
Main PID: 680 (firewalld)
Tasks: 2
CGroup: /system.slice/firewalld.service
└─680 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid
// 开启与关闭防火墙
systemctl start firewalld
systemctl stop firewalld
// 开启开机自启 enable
// 关闭开机自启 disable
三、软连接-(创建快捷方式)
使用 ln 命令创建软连接 (软连接 是什么玩意?)
奥~ 相当于windows里的发送到桌面的那个快捷方式
ln -s /etc/yum.conf ~/yum.conf
[root@localhost ~]# ls -l
总用量 8
-rw-r--r--. 1 root root 0 7月 20 04:36 1.txt
-rw-------. 1 root root 2993 7月 20 00:27 anaconda-ks.cfg
-rw-------. 1 root root 2107 7月 20 00:27 original-ks.cfg
drwxr-xr-x. 2 root root 6 7月 20 03:58 test
lrwxrwxrwx. 1 root root 13 7月 20 20:24 yum.conf -> /etc/yum.conf # 看看
# l表示是一个快捷方式
四、日期和时区
通过date命令可以在命令行中查看系统的时间
date
// 2023年 07月 20日 星期四 20:29:42 PDT
语法
date [-d] [+格式化字符串]
2 PDT
**语法**
date [-d] [+格式化字符串]