Linux系统7个运行模式

一、Linux系统运行模式

centos 6

0	关机模式
1	单用户模式 
2	字符模式, 无网络连接
3	字符模式
4	预留
5	图形模式
6	重启模式

查看系统当前的运行模式 
[root@localhost ~]# runlevel 
N 3

切换运行模式 
[root@localhost ~]# init 3


设置系统默认启动模式 
# vim /etc/inittab
id:3:initdefault

centos 7

字符模式	multi-user

切换字符模式 
[root@localhost ~]# systemctl isolate multi-user.target 

设置默认启动模式为字符模式 
[root@localhost ~]# systemctl set-default multi-user.target 


图形模式	graphical

切换图形模式
[root@localhost ~]# systemctl isolate graphical.target 

设置默认启动模式为图形模式
[root@localhost ~]# systemctl set-default graphical.target 

二、链接文件

链接文件类型:
	软链接/符号链接
	硬链接

区别:

软链接
	1、可以为文件、目录创建软链接 
	2、源文件与软链接文件可以跨分区 
	3、源文件失效、软链接文件也会失效
	
硬链接
	1、只可以为文件创建
	2、源文件、硬链接只能在同一个分区 
	3、源文件失效、硬链接还可以正常访问 
	

创建链接文件

# ln -s 源文件 链接文件 	
	-s: 创建软链接 

[root@localhost ~]# ln -s /opt/file01 /tmp/test1
[root@localhost ~]# ls -l /tmp/test1
lrwxrwxrwx. 1 root root 11 Dec 31 14:11 /tmp/test1 -> /opt/file01
[root@localhost ~]# 
posted @ 2023-03-25 10:43  nhxuan  阅读(399)  评论(0)    收藏  举报