admin管理员组

文章数量:1568343

文章目录

    • linux部署
      • vmware 中安装Ubuntu
        • VMware 下载
        • Ubuntu 下载
        • Ubuntu 的安装教程
      • Ubuntu ip地址的配置
      • 配置ssh 服务
        • 安装openssh-server
        • 查看ssh服务是否启动
        • 查看或修改配置文件`vim /etc/ssh/sshd_config`
      • Linux 常用命令
        • 内部命令
        • 外部命令
        • linux 下的帮助命令
          • man
          • info
          • help
        • 开关机命令
        • 文件和目录
          • 1、cd命令 切换目录
          • 2、pwd(Print Working Directory)显示当前工作路径
          • 3、ls(list) 列出当前路径下的文件和目录
          • 4、`file 文件或目录` 显示文件类型
          • 5、mkdir 创建目录
          • 6、touch 创建文件
          • 7、rm 删除文件
          • 8、mv (move) 文件移动或重命名
            • 文件重命名
            • 目录移动
            • 文件移动
            • 文件移动并重命名
          • 9、cp (copy) 文件复制
            • 常用选项
          • 10、ln命令(创建软链接和硬链接)
        • 文件权限
          • 权限
          • chmod 更改权限
          • chown 变更文件的拥有者和所属组
        • 文件查找
          • locate 命令
            • 说明
            • 使用方法
          • find 命令
            • 说明
            • 简单用法
          • grep 管道(过滤器)
          • which 命令
          • whereis 命令
        • 文件内容的查看和处理
          • cat 显示文件内容
          • less 一页一页的显示文件内容
          • head 显示文件头n行内容
          • tail 显示文件尾n行内容
          • sed命令
          • vim编辑器的使用
            • 命令模式:->编辑模式(a i o s)
            • ->尾行模式(: /)
            • 光标移动:
            • 内容删除
            • 内容复制
            • 相关快捷操作
            • 编辑模式
            • 尾行模式
            • 字符串的替换
            • 命令模式
        • 磁盘管理
          • df 命令
          • du 命令
          • fdisk 分区
          • mount 挂载
          • umount 取消挂载
        • 压缩解压缩
          • tar命令
          • zip 命令 打包为zip
          • unzip 命令 解包zip包
          • bzip2 命令
          • gzip 命令
        • 软件安装
          • rpm 包安装
          • deb 包安装
          • apt-get安装
          • yum 安装
      • ubuntu 下安装Java jdk 和tomcat 的配置
        • 软件准备
        • 安装jdk
        • 配置jdk 环境变量
        • 配置tomcat

linux部署

vmware 中安装Ubuntu

参见Windows10下安装Ubuntu18.04LTS详细教程

VMware 下载

VMware 下载网页

vmware 许可证:

VMware 2018 v14.x 永久许可证激活密钥
FF31K-AHZD1-H8ETZ-8WWEZ-WUUVA
CV7T2-6WY5Q-48EWP-ZXY7X-QGUWD

Ubuntu 下载

Ubuntu 下载网页

Ubuntu 的安装教程

参见Windows10下安装Ubuntu18.04LTS详细教程

Ubuntu ip地址的配置

参见Ubuntu 18.04 LTS设置固定ip

NAT 地址配置 需要编辑虚拟网络编辑器和vmnet8;

配置ssh 服务

安装openssh-server
sudo apt-get install openssh-server


这上面我已经安装过了

查看ssh服务是否启动

sudo ps -e |grep ssh

出现了sshd 则服务已经启动

如果没有启动 ,则输入sudo service ssh start 就OK

查看或修改配置文件vim /etc/ssh/sshd_config

默认端口是22
如果要修改的话,将Port 22 前面的#去掉,将22改成你想要设置的端口

使用putty登陆Ubuntu

接下来的练习,我们将在putty下进行

note:关于使用sudo apt-get install 软件名 出现Unable to lock the administration directory (/var/lib/dpkg/), is another proc错误的解决方案
首先:ps -A | grep apt 查看有关apt 的进程

892 ?        00:00:00 apt.systemd.dai
2516 ?        00:00:00 aptd

执行sudo kill -9 892 杀死进程

Linux 常用命令

内部命令

系统启动时就调入内存,是常驻内存的,所以执行效率高

外部命令

系统的软件功能,用户需要时才从硬盘中读入内存

通过type 命令名称 可以查看 命令的类型
eg:

xiaomo@xiaomoU:~$ type ls
ls is aliased to `ls --color=auto'
xiaomo@xiaomoU:~$ type cd
cd is a shell builtin

cd 就是系统的内部命令
ls 是外部命令

linux 下的帮助命令
man

man 命令 得到的内容比用 help 更多更详细,而且 man 没有内建与外部命令的区分,因为 man 工具是显示系统手册页中的内容,也就是一本电子版的字典,这些内容大多数都是对命令的解释信息,还有一些相关的描述。通过查看系统文档中的 man 也可以得到程序的更多相关信息和 Linux 的更多特性

eg:

man ls

在尝试上面这个命令时我们会发现最左上角显示“ LS (1)”,在这里,“ LS ”表示手册名称,而“(1)”表示该手册位于第一章节。这个章节又是什么?在 man 手册中一共有这么几个章节

章节数 说明
1 Standard commands (标准命令)
2 System calls (系统调用)
3 Library functions (库函数)
4 Special devices (设备说明)
5 File formats (文件格式)
6 Games and toys (游戏和娱乐)
7 Miscellaneous (杂项)
8 Administrative Commands (管理员命令)
9 其他(Linux特定的), 用来存放内核例行程序的文档。
打开手册之后我们可以通过 pgup 与 pgdn 或者上下键来上下翻看,可以按 q 退出当前页面

info

得到的信息比 man 还要多,info 来自自由软件基金会的 GNU 项目,是 GNU 的超文本帮助系统,能够更完整的显示出 GNU 信息

eg:

info ls

help

help 命令只能用于内部命令,不能用于外部命令
信息很简陋

eg:

xiaomo@xiaomoU:~$ help cd
cd: cd [-L|[-P [-e]] [-@]] [dir]
    Change the shell working directory.

    Change the current directory to DIR.  The default DIR is the value of the
    HOME shell variable.

    The variable CDPATH defines the search path for the directory containing
    DIR.  Alternative directory names in CDPATH are separated by a colon (:).
    A null directory name is the same as the current directory.  If DIR begins
    with a slash (/), then CDPATH is not used.

    If the directory is not found, and the shell option `cdable_vars' is set,
    the word is assumed to be  a variable name.  If that variable has a value,
    its value is used for DIR.

    Options:
      -L        force symbolic links to be followed: resolve symbolic
                links in DIR after processing instances of `..'
      -P        use the physical directory structure without following
                symbolic links: resolve symbolic links in DIR before
                process

本文标签: 入门环境UbuntuJava