- 更新源
sed -ri 's/http:////(cn.)?archive.ubuntu.com//ubuntu///https:////mirrors.tuna.tsinghua.edu.cn//ubuntu///g' /etc/apt/sources.list
apt-get update
- Ubuntu 修改IP
vi /etc/netplan/xx.yaml
netplan apply
- Ubuntu16.04 修改IP
#删除ip
ip addr del 192.168.0.1 dev eth0
#修改ip
vi /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.5.205
netmask 255.255.255.0
gateway 192.168.5.1
dns-nameservers 192.168.5.28 172.30.44.20
#修改DNS
vi /etc/resolvconf/resolv.conf.d/base
#如果本Server为DNS服务器,可以加上这一句,如果不是,可以不加
search localdomain
nameserver 172.16.3.4
#重启服务
/etc/init.d/networking restart
/etc/init.d/resolvconf restart
- 配置root密码
sudo –i
passwd
- 任务的后台执行
&
将指令丢到后台中去执行[ctrl]+z
将前台任务丢到后台中暂停jobs
查看后台的工作状态fg %jobnumber
将后台的任务拿到前台来处理bg %jobnumber
将任务放到后台中去处理kill
杀死后台的任务
- 项目压缩包常用
#tar包解压
tar zxvf –C 指定路径
#软链接
ln –s 原文件名 指定文件名
- systemctl命令
systemctl list-units
列出当前系统服务的状态systemctl list-unit-files
列出服务的开机状态systemctl status sshd
查看指定服务的状态systemctl stop sshd
关闭指定服务systemctl start sshd
开启指定服务systemctl restart sshd
从新启动服务systemctl enable sshd
设定指定服务开机开启systemctl disable sshd
设定指定服务开机关闭systemctl reload sshd
使指定服务从新加载配置systemctl list-dependencies sshd
查看指定服务的倚赖关系systemctl mask sshd
冻结指定服务systemctl unmask sshd
启用服务systemctl set-default
multi-user.target 开机不开启图形systemctl set-default
graphical.target 开机启动图形setterm
文本界面设定color
- 清理服务
systemctl stop [servicename]
systemctl disable [servicename]
rm /etc/systemd/system/[servicename]
rm /etc/systemd/system/[servicename] # and symlinks that might be related
rm /usr/lib/systemd/system/[servicename]
rm /usr/lib/systemd/system/[servicename] # and symlinks that might be related
systemctl daemon-reload
systemctl reset-failed
- 字符集
locale –a
查看下载的字符集
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/281077.html