Skip to content

Linux笔记

创建zsh别名

shell
alias zsh vim ~/.zshrc alias pd="pnpm run dev"

查看公网IP

shell
curl ifconfig.me

更新包和源

shell
# Ubuntu
apt-get update

# CentOS、Red Hat
yum update
rpm -Uvh [args]

先把服务器上所有的包和源都check和更新一遍,让服务器处在一个崭新的状态。

安装unzip解压缩工具

shell
yum install unzip -y

安装vim

shell
yum install vim -y

vim使用技巧

  • 快速清空:打开文件,第一行输入:dG,即可从头到尾清空所有文本信息
  • 显示行数:输入:set nu,即可显示行数

了解更多:vim使用教程

重启ssh

shell
# CentOS 6或以下
service ssh restart
# CentOS 7或以上
systemctl restart sshd

启动服务

启动服务 systemctl start [name]

shell
systemctl start mariadb.service
systemctl start httpd.service

停止服务 systemctl stop [name]

设置自启 systemctl enable [name]

查看状态 systemctl status [name]

附录

最近更新