Linux

  1. 计算机历史:电子管、晶体管、集成电路、大规模集成电路

  2. 操作系统分类

    1. 移动端:Android、iOS、鸿蒙

    2. 电脑端:Unix、Linux、macOS、Windows

  3. Linux介绍

    1. 基于Unix的开源免费的操作系统。由于系统的稳定性和安全性几乎成为程序代码运行的最佳系统环境。

    2. 分类

      1. 市场需求:图形化界面、服务器版

      2. 原生程度:

        1. 内核版本

        2. 发行版本:Ubuntu、centOS、Redhat、麒麟、红旗

  4. Linux安装

    1. 虚拟机:VMware、VirtualBox

      VMware傻瓜式安装,激活

    2. Linux系统

      VMware → 新建虚拟机 → 典型安装 → 镜像文件centos-7 → 设置全名、用户名、密码 → 虚拟机名称和安装位置 → 磁盘大小20G → 完成 → 等待 → 创建用户

  5. 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>
  1. 远程连接工具

    1. 原因:①远程操作Linux服务器②远程控制机器

    2. 工具:ssh、xshell、finalShell

    3. ssh:安装、使用

    4. 获取不到IP?

      1. 查看虚拟机是否联网,可以切换虚拟机中的桥接和nat

      2. 查看Windows下网络适配器是否有两个vm的,没有选择重现安装VM或者https://blog.csdn.net/weixin_47397805/article/details/112393232?spm=1001.2014.3001.5501

      3. 查看服务是否全部开启

  2. 环境搭建

    1. 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>
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 教学目标1、掌握Linux系统上安装JDK的安装2、掌握Linux系统上安装Mysql的安装3、掌握Linux系统...
    Anwfly阅读 5,875评论 0 5
  • 一、远程连接工具的使用 1. 为什么使用远程连接工具 (1)实际应用中服务器一般放在远端(机房)或者云服务上,测试...
    你与凯尔皆天使阅读 1,423评论 0 0
  • 一、远程连接工具的使用 1. 为什么使用远程连接工具 (1)实际应用中服务器一般放在远端(机房)或者云服务上,测试...
    荒年_22b2阅读 3,003评论 0 0
  • 一、Linux系统介绍 1.操作系统的分类 1.1 操作系统的定义 操作系统(Operating System,简...
    故里里阅读 3,633评论 0 1
  • 一、Linux系统介绍 1.操作系统的分类 1.1 操作系统的定义 操作系统(Operating System,简...
    Y_8f89阅读 3,587评论 0 0