计算机历史:电子管、晶体管、集成电路、大规模集成电路
-
操作系统分类
移动端:Android、iOS、鸿蒙
电脑端:Unix、Linux、macOS、Windows
-
Linux介绍
基于Unix的开源免费的操作系统。由于系统的稳定性和安全性几乎成为程序代码运行的最佳系统环境。
-
分类
市场需求:图形化界面、服务器版
-
原生程度:
内核版本
发行版本:Ubuntu、centOS、Redhat、麒麟、红旗
-
Linux安装
-
虚拟机:VMware、VirtualBox
VMware傻瓜式安装,激活
-
Linux系统
VMware → 新建虚拟机 → 典型安装 → 镜像文件centos-7 → 设置全名、用户名、密码 → 虚拟机名称和安装位置 → 磁盘大小20G → 完成 → 等待 → 创建用户
-
Linux命令
<pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang="python" cid="n845" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit;"># 根目录下
etc:系统配置文件
usr:资源文件
home:用户
# 目录的切换
cd 全路径
cd ../
cd ~
cd /
# 文件夹的操作
mkdir filename
rm -rf filename
mv oldpath newpath # 修改、移动
cp -r oldpath newpath
ls [-a/l]
ll
find path -name filaname
# 文件
touch filename
cat:最后一屏
more:从开始的百分比,空格下一页,回车下一行,q退出
less:第一屏,上下键换行,q退出
tail:tail -10代表最后10行,tail -f 文件 实时查看文件内容
vim filename 命令行模式 → a/i/o编辑模式 → esc:底行模式 → wq q!
tar -zcvf 压缩后文件.tar.gz 被压缩文件
tar -xvf 压缩后文件.tar.gz -C 被解压目标位置
unzip 文件.zip
# 其他
pwd
grep 串 文件
|
ps -ef
ps -ef | grep 串
kill -9/-15 pid
ifconfig
ping 地址
netstat -an
# 修改权限,777含义
drwxrwxrwx
chmod u=rwx,g=rwx,o=rwx filename
chmod 777 filename
free
df -h
top
reboot
shutdown -h now
shutdown -h +10
shutdown -h 12:20</pre>
-
远程连接工具
原因:①远程操作Linux服务器②远程控制机器
工具:ssh、xshell、finalShell
ssh:安装、使用
-
获取不到IP?
查看虚拟机是否联网,可以切换虚拟机中的桥接和nat
查看Windows下网络适配器是否有两个vm的,没有选择重现安装VM或者https://blog.csdn.net/weixin_47397805/article/details/112393232?spm=1001.2014.3001.5501
查看服务是否全部开启
-
环境搭建
- JDK
<pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang="python" cid="n869" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit;">#1\. 查看已经jdk
rpm -qa | grep java
#2\. 卸载含有openjdk
rpm -e --nodeps openjdk
#3\. 解压压缩到usr/local/jdk
tar -xvf openjdk.tar.gz -C /usr/lacal/jdk
#4\. 配置jdk环境变量
vim /etc/profile → a/i/o
JAVA_HOME=/usr/local/jdk/jdk1.8.0_131
CLASSPATH=.:$JAVA_HOME/lib.tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH
#5\. 刷新文件,查看jdk是否安装成功
resource /etc/profile
jsk -version</pre>
2. MySQL
<pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang="python" cid="n872" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit;">#1\. 查看是否包含mysql/mariadb并卸载,删除含有mysql的文件及文件夹
rpm -qa | grep mysql/mariadb
rpm -e --nodeps mysql/mariadb
find / -name mysql
rm -rf mysql路径
#2\. 解压
tar -xvf mysql -C /usr/local/mysql
#3\. 安装
//安装依赖
[root@fgy src]# yum install libaio
[root@fgy src]# yum install perl
[root@fgy src]# yum install net-tools
//安装mysql
[root@localhost src]# rpm -ivh mysql-community-common-55.7.29-1.el7.x86_64.rpm
[root@localhost src]# rpm -ivh mysql-community-libs-5.7.29-1.el7.x86_64.rpm
[root@localhost src]# rpm -ivh mysql-community-client-5.7.29-1.el7.x86_64.rpm --nodeps --force
[root@localhost src]# rpm -ivh mysql-community-server-5.7.29-1.el7.x86_64.rpm --nodeps --force
#4\. 启动并查看状态
service mysqld start
service mysqld status
#5\. 登录
grep password /var/log/mysqld.log
mysql -u root -p
#6\. 修改密码
set global validate_password_policy=0;
set password = password('123456');
#7\. 重新登录
mysql -u root -p
12345678
#8\. 退出mysql
eixt</pre>
3. Tomcat
<pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang="python" cid="n875" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit;">#1\. 解压
tar -xvf tomcat.tar.gz -C /usr/local/tomcat/
#2\. 开放端口号
# 查看已开放的端口号
firewall-cmd --list-ports
# 开启防火墙
systemctl start firewalld
# 添加端口号
firewall-cmd --zone=public --add-port=8080/tcp --permanent
# 重启防火墙
firewall-cmd --reload
#3\. 启动
cd tomcat/bin
startup.sh
shutdown.sh
# Linux访问
127.0.0.1:8080
# Windows访问
Linux的ip:8080</pre>
4. Jenkins
<pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang="python" cid="n878" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit;">#1\. 复制Jenkins.war到/usr/local/tomcat/.../webapps
cp jenkins.war /usr/local/tomcat/.../webapps
shutdown.sh
startup.sh
#2\. 自动解压
127.0.0.1:8080/jenkins
Linux的ip:8080
# jenkins 配置
#1\. 127.0.0.1:8080/jenkins
#2\. 查密码并填写
#3\. 安装推荐插件
#4\. 管理员用户
#5\. 开始 → jenkins主界面</pre>