Linux操作命令之云计算基础命令

一、图形化界面/文本模式

复制代码
ctrl+alt+F2-6      图形切换到文本
ctrl+alt  鼠标跳出虚拟机
ctrl+alt+F1    文本切换到图形
shift  +  ctrl +  "+"   扩大
ctrl +  "-"  缩小
shift  +  ctrl +  "n"  新终端
shift  +  ctrl +  "t"   新标签
alt + 1, 2 ,3  切换标签
shift  +  ctrl +  "w"  关闭标签
alt + F4 关闭终端
ctrl+c  中断命令
ctrl+l  清屏

二、修改网卡配置

复制代码
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens33
ONBOOT=yes
ESC键
shift + :    末行
:wq 
[root@localhost ~]# systemctl restart network
[root@localhost ~]# ip addr show

三、mobax连接

四、修改主机名

复制代码
[root@localhost ~]# hostnamectl set-hostname robin.com      设置主机名
[root@localhost ~]# vi /etc/hosts    解析主机名
你的ip地址  robin.com
ESC键
shift+:
:wq

五、关闭防火墙

复制代码
[root@controller ~]# systemctl stop firewalld
[root@controller ~]# systemctl disable firewalld

六、关闭selinux

复制代码
[root@controller ~]# setenforce 0
[root@controller ~]# vi /etc/selinux/config
SELINUX=disabled
ESC键
shift+:
:wq

关机:
[root@controller ~]# init 0      关机
[root@controller ~]# init 6      重启

七、同步时间

复制代码
[root@controller ~]# ntpdate ntp.aliyun.com
30 Dec 15:21:46 ntpdate[3271]: step time server 203.107.6.88 offset -28799.275663 sec

八、切换语言

复制代码
[root@controller ~]# LANG=c
[root@controller  ~]# LANG=zh_CN.utf-8
[root@controller ~]# LANG=en_US.utf-8

九、安装tree命令,配置yum源

复制代码
[root@controller ~]#  wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.huaweicloud.com/repository/conf/CentOS-7-anon.repo
[root@controller ~]# yum install -y tree

十、重置root密码

1.按e编辑启动项

2.找到vmlinuz删除到ro 输入rd.break

3.按快捷键 ctrl+x, 进入修复模式

4.以读写方式挂载sysrootmount -o remount,rw /sysroot/

5.进入 /sysroot 子系统重置密码

6.强制重置文件系统的上下文 touch /.autorelabel

7.执行两次 exit 退出,重置系统文件上下文,会有个百分比

相关推荐
一叶龙洲3 分钟前
ubuntu 25.10安装oh-my-zsh
linux·ubuntu
IT19953 分钟前
Linux笔记-使用systemd管理进程
linux·运维·笔记
Web极客码3 分钟前
WordPress 在哪里存储网站上的图片?
运维·服务器·wordpress
想逃离铁厂的老铁9 分钟前
Day60 >> 94、城市间货物运输1️⃣ + 95、城市间货物运输 2️⃣ + 96、城市间货物运输 3️⃣
java·服务器·前端
杜子不疼.10 分钟前
用Claude Code构建AI内容创作工作流:从灵感到发布的自动化实践
运维·人工智能·自动化
草莓熊Lotso10 分钟前
从零手搓实现 Linux 简易 Shell:内建命令 + 环境变量 + 程序替换全解析
linux·运维·服务器·数据库·c++·人工智能
User_芊芊君子13 分钟前
【LeetCode原地复写零】:双指针+逆向填充,O(n)时间O(1)空间最优解!
android·linux·leetcode
人工智能训练8 小时前
【极速部署】Ubuntu24.04+CUDA13.0 玩转 VLLM 0.15.0:预编译 Wheel 包 GPU 版安装全攻略
运维·前端·人工智能·python·ai编程·cuda·vllm
微露清风9 小时前
系统性学习Linux-第二讲-基础开发工具
linux·运维·学习
不会代码的小猴9 小时前
Linux环境编程第六天笔记--system-V IPC
linux·笔记