文章目录
linux部署
vmware 中安装Ubuntu
参见Windows10下安装Ubuntu18.04LTS详细教程
VMware 下载
vmware 许可证:
VMware 2018 v14.x 永久许可证激活密钥
FF31K-AHZD1-H8ETZ-8WWEZ-WUUVA
CV7T2-6WY5Q-48EWP-ZXY7X-QGUWD
Ubuntu 下载
Ubuntu 的安装教程
参见Windows10下安装Ubuntu18.04LTS详细教程
Ubuntu 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