PING baidu.com (110.242.68.66) 56(84) bytes of data.
64 bytes from 110.242.68.66 (110.242.68.66): icmp_seq=1 ttl=128 time=27.5 ms
[root@localhost ~]# systemctl stop firewalld
ystemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: inactive (dead) since 二 2024-03-26 21:00:13 CST; 2min 18s ago
Docs: man:firewalld(1)
Process: 705 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)
Main PID: 705 (code=exited, status=0/SUCCESS)
3月 26 19:44:55 localhost.localdomain systemd[1]: …
3月 26 19:44:56 localhost.localdomain systemd[1]: …
3月 26 19:44:57 localhost.localdomain firewalld[705]: …
3月 26 21:00:12 localhost.localdomain systemd[1]: …
3月 26 21:00:13 localhost.localdomain systemd[1]: …
Hint: Some lines were ellipsized, use -l to show in full.
systemctl start firewalld
[root@localhost ~]# 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 二 2024-03-26 21:04:38 CST; 1min 7s ago
Docs: man:firewalld(1)
Main PID: 9130 (firewalld)
CGroup: /system.slice/firewalld.service
└─9130 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid
3月 26 21:04:38 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewal…
3月 26 21:04:38 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall…n.
3月 26 21:04:38 localhost.localdomain firewalld[9130]: WARNING: AllowZoneDrifting is en…
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost ~]# systemctl disable firewalld
[root@localhost ~]# setenforce 0
[root@localhost ~]# setenforce 1
- * 永久关闭防火墙
- * ```
- [root@localhost ~]# vi /etc/selinux/config
- bled
- # This file controls the state of SELinux on the system.
- # SELINUX= can take one of these three values:
- # enforcing - SELinux security policy is enforced.
- # permissive - SELinux prints warnings instead of enforcing.
- # disabled - No SELinux policy is loaded.
- SELINUX=enforcing
- # SELINUXTYPE= can take one of three values:
- # targeted - Targeted processes are protected,
- # minimum - Modification of targeted policy. Only selected processes are protected.
- # mls - Multi Level Security protection.
- SELINUXTYPE=targeted
- ~
- ~
- ~
- ~
- :wq
复制代码
- [root@localhost ~]# getenforce
复制代码 4.快照
如果出现标题,可以通过规复前面的快照,规复快照时的指令
5.路径-目录的创建
- Ls 检察当前路径
- Ls /中国 检察路径下中国文件
- CD切换目录
- Cd … 返回上一级目录
- Cd . 当前目录
- Cd …/…/./点点数量返回次数,好比在西安,通过此返回到西安。
- Cd -返回上一次进入的目录
- CD /中国 切换到中国的路径
- Pwd 检察当前所在目录(检察
绝对路径
,即/中国/陕西)
- Mkdir 创建目录
- Mkdir /a 在根下创建的目录
- Mkdir a 在所在目中创建的一个小小根
- Mkdir -p 直接在用户名下指定根下创建目录
- Mkdir-v检察创建过程
- Yum install tree 安装tree
- [root@localhost /]# ls
- 01 boot etc lib media proc run srv tmp var 学习
- bin dev home lib64 mnt root sbin sys usr zhongguo 中国
- [root@localhost /]#
- [root@localhost /]# mkdir -p /opt/a/b/c
- [root@localhost /]# tree /opt
- /opt
- └── a
- └── b
- └── c
- 3 directories, 0 files
复制代码 touch 创建文本
- [/code]
- [/list] [root@localhost home]# touch /opt/file.txt
- [root@localhost home]# tree /opt
- /opt
- ├── a
- └── file.txt
- 1 directory, 1 file
- [code]
- 查找小知识:当yum关闭,执行rm -f /var/run/yum.pid后正常进行yum安装的内容
- 终端连接到服务器重要使用IP进行连接,使用的是ssh进行协议连接,ssh root @192.168.42.125(端口号22位)
- ### 6.文件拷备
- 拷贝主要使用命令词cp
复制代码 [root@localhost /]# cp -r /opt/a /tmp
[root@localhost /]# cd /tmp
[root@localhost tmp]# ls
a
ks-script-6_CVQf
systemd-private-21884cc5cf934fa897803901bc0c5010-chronyd.service-9VXlBi
systemd-private-278a64b471014c7c9e06255891e9db60-chronyd.service-V6LscI
systemd-private-4ba49a680b2143acad4b4f22972a738d-chronyd.service-cpie7T
systemd-private-7700d0306cf04fa7974aded2a5b4163b-chronyd.service-hqtM4M
systemd-private-7d007bbf789a46f98aae0f9ce4b79c59-chronyd.service-EpYhNT
systemd-private-90d6be988e1a4f04a156c442b76d1669-chronyd.service-Mo5Xuj
systemd-private-a03007a2665542b192b481f04ec40f07-chronyd.service-0fQMtS
systemd-private-d2783f5906cf4b6ba77272eed962d29f-chronyd.service-xaDnqE
systemd-private-f86f9439466540fe8135d13c42f5605b-chronyd.service-VB5RIR
yum.log
- >
- > 扩展:在复制中,可以对复制的内容进行重命名 (cp -r /otp/a /tmp/a-1)
- >
- >
- >
- ### 7.文件移动
- 拷贝主要使用命令词mv
复制代码 [root@localhost opt]# cd /home
[root@localhost home]# ls
etc ifcfg-ens33 passwd tt yun
[root@localhost c]# rm -rf /opt/a/b
[root@localhost opt]# tree /opt/a
/opt/a
0 directories, 0 files
[root@localhost opt]# tree /opt
/opt
└── a
1 directory, 0 files
[root@localhost tmp]# cd
[root@localhost ~]# cd /
[root@localhost /]# cd opt
[root@localhost opt]# cd a
[root@localhost a]# cd b
[root@localhost b]# cd c
[root@localhost c]# cd …
[root@localhost b]# cd …/…/…
[root@localhost /]# cd otp
-bash: cd: otp: 没有那个文件或目录
[root@localhost /]# cd opt
[root@localhost opt]# tree
.
└── a
└── b
└── c
3 directories, 0 files
[root@localhost ~]# cd /opt/a/b/c
[root@localhost c]#
- ### 10.查看各个指定路径下的文件
- 使用代码 tree
复制代码 [root@localhost home]# tree /etc/sysconfig
/etc/sysconfig
├── anaconda
├── authconfig
├── cbq
│ ├── avpkt
│ └── cbq-0000.example
├── chronyd
├── console
├── cpupower
├── crond
├── ebtables-config
├── firewalld
├── grub -> …/default/grub
├── init
├── ip6tables-config
├── iptables-config
├── irqbalance
├── kdump
├── kernel
├── man-db
├── modules
├── netconsole
├── network
├── network-scripts
│ ├── ifcfg-lo
│ ├── ifdown -> …/…/…/usr/sbin/ifdown
│ ├── ifdown-bnep
│ ├── ifdown-eth
│ ├── ifdown-ippp
│ ├── ifdown-ipv6
│ ├── ifdown-isdn -> ifdown-ippp
│ ├── ifdown-post
│ ├── ifdown-ppp
│ ├── ifdown-routes
│ ├── ifdown-sit
│ ├── ifdown-Team
│ ├── ifdown-TeamPort
│ ├── ifdown-tunnel
│ ├── ifup -> …/…/…/usr/sbin/ifup
│ ├── ifup-aliases
│ ├── ifup-bnep
│ ├── ifup-eth
│ ├── ifup-ippp
│ ├── ifup-ipv6
│ ├── ifup-isdn -> ifup-ippp
│ ├── ifup-plip
│ ├── ifup-plusb
│ ├── ifup-post
│ ├── ifup-ppp
│ ├── ifup-routes
│ ├── ifup-sit
│ ├── ifup-Team
│ ├── ifup-TeamPort
│ ├── ifup-tunnel
│ ├── ifup-wireless
│ ├── init.ipv6-global
│ ├── network-functions
│ └── network-functions-ipv6
├── ntpdate
├── rdisc
├── readonly-root
├── rsyslog
├── run-parts
├── selinux -> …/selinux/config
├── sshd
└── wpa_supplicant
4 directories, 61 files
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
|