Debian系列和Red Hat系列常用命令

Debian系列(麒麟、UOS、ubuntu、kali)常用命令

apt update  更新软件包列表
apt upgrade 升级所有已安装的安装包
apt install apache   安装软件命令(apache为一个软件名)
apt remove apache  卸载软件
apt search apache   搜索软件
apt list  --installed  列出所有已安装的软件按包
apt list  --upgradable 列出可以升级的软件包
/etc/apt/sources.list    源地址配置文件

Red Hat系列(CentOS)常用命令

yum update   更新系统中所有已安装的软件
yum install apache 安装软件命令(apache为一个软件名)
yum remove apache 卸载软件
yum search apache 搜索软件
yum list  列出所有可安装的软件
yum list installed 列出所有已安装的软件按包
yum list updates 列出可以升级的软件包
yum clean all 清除缓存目录下的旧安装包
/etc/yum.repos.d/CentOS-Base.repo  源地址配置文件

Linux常用文件管理命令

mkdir 123   创建文件夹(123为文件夹名)
mkdir -p /root/123/456  递归创建文件夹
mv   移动文件或重命名
mv /root/123.txt  /tmp/123.txt    移动
mv /root/123.txt  /root/456.txt    重命名
cp  复制文件
cp /root/*.txt  /tmp/  将root下的txt文件复制到tmp下
touch  1.txt  创建文件,可创建多种格式(.sh .c .py等)
rm 1.txt  删除文件
rm -rf 123 强制删除文件夹
ls -l  查看当前目录下的文件
pwd 查看当前所在目录
cat 1.txt 查看文件内容
vim 1.txt 编辑1.txt文件
tar -czvf 123.tar.gz /123   123.tar.gz为要打包压缩的文件及后缀 /123为要压缩的文件
tar -zxvf 123.tar.gz  解压文件
chmod   文件权限设置命令
find / -name 1.txt 文件搜索命令,搜索根目录下的123.txt

Linux系统常用命令

ping  探测主机联通性
ifconfig  查看ip
ip add  查看ip
systemctl start sshd启动sshd(sshd为举例) systemctl 控制系统服务 
systemctl status sshd 查看sshd的状态
systemctl stop sshd 停止sshd
systemctl restart sshd 重启sshd
systemctl enable sshd 设置开机自启
systemctl disable sshd 禁用开机自启
iptables -L 列出系统所有防火墙规则
firewall-cmd --list-all 列出系统所有防火墙规则
top -c -o %CPU  -c显示进程的命令    -o按照CPU占用从大到小排序
ps 查看进程
netstat 查看网络状态
kaill -9 PID 结束进程  ps或top可看到软件进程PID
whoami  查看当前用户
id 查看当前用户所属组信息
free -h 查看系统内存
df -h 查看磁盘
rpm -ivh apache.rpm  安装软件
wget  http://123.com/123.txt下载文件
curl -O http://123.com/123.txt  下载
uname -a 查看系统信息
cat /proc/version  查看内核版本
lsb_release -a 查看发行版本
  • 5
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

啊醒

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值