更新源
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-defaultmulti-user.target 開機不開啟圖形
systemctl set-defaultgraphical.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查看下載的字符集
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/502089.html
標籤:Linux
上一篇:podman基礎用法
下一篇:Linux—權限管理
