1.1 系统命令
runlevel # 查看当前的运行级别
systemctl status sshd # 开启网络服务功能
stop # 关闭
restart # 重启
reload # 重载
reboot # 重启
halt # 关机
poweroff # 关机
1.2 查看文件常用指令
cat # 在命令提示符下查看文件内容
more # 在命令提示符中分页查看文件内容
less # 命令行中查看文件可以上下翻页反复浏览
head # 命令行中查看文件头几行
tail # 命令行中查看文件尾几行
wc # 统计文件的单词数 行数等信息
1.3 目录管理常用指令
pwd # 查看你当前所在的目录
cd # 切换目录
ls # 查看显示目录的内容
du # 统计目录和文件空间的占用情况
mkdir # 创建新目录
rmdir # 删除空目录
touch # 创建文件
rm # 删除文件
ln # 创建硬链接
ln -s # 创建软链接
cp # 复制文件或目录
mv # 移动文件或目录
which # 查看linux命令所在的目录
2.ubuntu开启sshd服务
安装sshd
root@dev:shiyanlou_project# sudo apt-get install openssh-server
root@dev:shiyanlou_project# /etc/init.d/ssh status
root@dev:shiyanlou_project# netstat -anptu | grep sshd
开启root远程登录功能
Port 22 # 去掉注释
#PermitRootLogin prohibit-password
PermitRootLogin yes # 把上面的换成yes
重启sshd服务
root@dev:shiyanlou_project# service sshd restart
3.ubuntu 安装软件
sudo apt-get install XXX
sudo apt-get install -y XXX
sudo apt-get remove XXX