Linux 清理系统

kisu3年前笔记229912
## 清理系统软件包
sudo apt clean && sudo apt autoclean && sudo apt autoremove --purge

## 清理系统缓存
sudo rm -rvf /var/cache/apt/* /var/lib/apt/lists/* /tmp/*

## 清理系统日志
sudo find /var/log/ -type f | xargs sudo rm -rvf

## 清理命令历史记录文件
rm -rvf ~/.bash_history ~/.zsh_history

## 清理命令历史
history -c



红帽系:

yum clean all
> /etc/machine-id
rm -f /etc/ssh/ssh_host_*
rm -rf /root/.ssh/
rm -f /root/anaconda-ks.cfg
unset HISTFILE
rm -f /var/log/boot.log
rm -f /var/log/cron
rm -f /var/log/dmesg
rm -f /var/log/grubby
rm -f /var/log/lastlog
rm -f /var/log/maillog
rm -f /var/log/messages
rm -f /var/log/secure
rm -f /var/log/spooler
rm -f /var/log/tallylog
rm -f /var/log/wpa_supplicant.log
rm -f /var/log/wtmp
rm -f /var/log/yum.log
rm -f /var/log/audit/audit.log
rm -f /var/log/ovirt-guest-agent/ovirt-guest-agent.log
rm -f /var/log/tuned/tuned.log
rm -f /etc/udev/rules/70-persistent-*-rules
sys-unconfig
rm -f /root/.bash_history


Debian系:

apt clean all
> /etc/machine-id
rm -f /etc/ssh/ssh_host_*
rm -rf /root/.ssh/
rm -f /root/anaconda-ks.cfg
unset HISTFILE
> /var/log/auth.log
> /var/log/daemon.log
> /var/log/dpkg.log
> /var/log/kern.log
> /var/log/syslog
> /var/log/alternatives.log
> /var/log/apt/history.log
> /var/log/apt/term.log
rm -rf /var/mail/*
rm -f /etc/udev/rules/70-persistent-*-rules
rm -f /var/lib/dhcp/dh*.leases*
rm -f /root/.bash_history


相关文章

open vswitch 阻止所有虚拟机使用25端口出站

open vswitch 阻止所有虚拟机使用25端口出站

Q: 物理主机上有很多虚拟机,网卡使用了open vswitch技术,每个虚拟机都有自己独立的外部ip地址。如何在主机上设置ovs-ofctl来阻止所有虚拟机使用25端口出站。A: ...

Linux 新增磁盘的格式化与挂载

在Linux系统中,为新磁盘进行格式化并挂载它以供使用是一个常见的任务。以下是你可以按照步骤操作的指南,请确保在执行这些步骤前备份任何重要数据,因为格式化过程会清除磁盘上的所有数据。1. 识别新磁盘:...

PVE更换库

nano /etc/apt/sources.list.d/pve-install-repo.list nano /etc/apt/sources.list.d/pve-enter...

宝塔面板7.7.0

首先,安装官方版本。接下来:wget https://raw.githubusercontent.com/qimomo/btpanel-v7.7.0/main/install/src/Lin...

评论列表

指尖站群
2024-07-05 07:26:33

楼主的帖子提神醒脑啊!http://7klb4.tzpvzvs.cn/

指尖站群
2024-07-05 10:17:56

赞一个!http://rbb8.xpmona.com.cn/

访客
2024-07-06 02:27:11

楼主主机很热情啊!http://akpa8.hczy168.com/

访客
2024-07-06 02:32:24

楼主看起来很有学问!http://eyrv.hczy168.com/

访客
2024-07-06 02:36:51

楼主很有经验啊!http://9lguor.hczy168.com/

访客
2024-07-06 02:41:10

这位作者的文笔极其出色,用词精准、贴切,能够形象地传达出他的思想和情感。http://8e9.hczy168.com/

访客
2024-07-06 02:54:24

收藏了,怕楼主删了!http://cvawfl.hczy168.com/

访客
2024-07-06 02:59:48

很经典,收藏了!http://bwisp.http://3bi.net/post/3399.html/

访客
2024-07-06 10:34:33

楼主很有艺术范!http://r7dake.taianshuangchi.com/

访客
2024-07-06 22:11:39

祖国尚未统一,我却天天灌水,好内疚!http://owpg0.nobao.com.cn/

访客
2024-07-06 22:23:23

楼主内心很强大!http://zopuon.vast-tv.com/

访客
2024-07-06 22:30:41

楼主的文笔不错!http://76olq.nobao.com.cn/

访客
2024-07-06 22:37:50

信楼主,得永生!http://jzb9.bjdingsong.com/

访客
2024-07-06 22:43:23

信楼主,考试不挂科!http://cmtlw.forosweb.org/

游客
2024-07-07 01:38:21

投楼主一票,不用谢哦!http://gimjk.kblewwq.cn

游客
2024-07-07 02:08:59

好好学习楼主的帖子!http://8d9j.sophmoon.cn

访客
2024-07-07 04:47:48

楼上的别说的那么悲观好吧!http://np8.bjdingsong.com/

访客
2024-07-07 04:54:19

楼主的帖子越来越有深度了!http://ogfhx.forosweb.org/

访客
2024-07-07 04:55:57

鸟大了,什么林子都敢进啊!http://uu9m4.forosweb.org/

游客
2024-07-07 06:01:38

感谢楼主的推荐!http://j5dnml.06gk.cn

游客
2024-07-07 07:08:07

信楼主,得永生!http://bg4.390j.cn

游客
2024-07-07 07:34:15

有品位!http://0l7v8w.e8jes3c.cn

游客
2024-07-07 08:45:22

楼主是一个典型的文艺青年啊!http://mty.xmona.com.cn

游客
2024-07-07 10:24:40

大神好强大!http://jh0.yipin112.com.cn

游客
2024-07-07 11:11:20

看了这么多帖子,第一次看到这么有深度了!http://u5lb29.tzpvzvs.cn

游客
2024-07-07 20:44:50

大神就是大神,这么经典!http://aqb5.baodiyangzhi.com

游客
2024-07-07 22:38:49

白富美?高富帅?http://www.lealino.com

游客
2024-07-08 03:27:14

楼主的等级很高啊!http://www.knkzn.com

游客
2024-07-08 08:17:01

突然觉得楼主说的很有道理,赞一个!http://www.hcyyg.com

访客
2024-07-08 08:25:30

很多天不上线,一上线就看到这么给力的帖子!http://v85j.blggs.net/

访客
2024-07-08 08:44:46

楼主加油,看好你哦!http://ai01.beiguoqiche.com/

游客
2024-07-08 10:36:20

感觉不错!http://gx.baishanct.com

游客
2024-07-08 14:28:15

小弟默默的路过贵宝地~~~http://9qtx3.jualapartemenbandung.com

游客
2024-07-08 15:23:05

坚持回帖!http://wap.jsailitejz.com

游客
2024-07-08 15:33:53

无图无真相!http://dmmt.zjchuzhou.com

游客
2024-07-08 16:31:25

楼上的真不讲道理!http://i7d2.xmona.com.cn

游客
2024-07-08 21:48:05

读了楼主的帖子,顿时马桶就通了。。。http://www.jryhkmr.com

游客
2024-07-08 21:48:11

楼主的帖子提神醒脑啊!http://www.bwqgj.com

游客
2024-07-08 21:49:42

看了这么多帖子,第一次看看到这么有内涵的!http://rhry.gdlasa.com

游客
2024-07-08 21:49:52

收藏了,怕楼主删了!http://9yh.china-spwj.com

游客
2024-07-08 21:52:53

好东西,学习学习!http://mobile.jsailitejz.com

游客
2024-07-08 22:04:20

楼主的头像是本人吗?http://ui38.jualapartemenbandung.com

游客
2024-07-08 22:07:33

无图无真相!http://51588.jualapartemenbandung.com

游客
2024-07-08 22:07:43

读了楼主的帖子,顿时马桶就通了。。。http://q4127.jualapartemenbandung.com

游客
2024-07-08 22:53:01

看了这么多帖子,第一次看到这么高质量内容!http://yc5x5.china-spwj.com

游客
2024-07-08 23:15:37

很给力!http://8dcg8.xmona.cn

游客
2024-07-08 23:18:34

看了这么多帖子,第一次看到这么有深度了!http://xlw.008jeans.com

游客
2024-07-08 23:27:30

坚持回帖!http://y305tu.008jeans.com

游客
2024-07-08 23:33:26

雷锋做好事不留名,都写在帖子里!http://r68t.008jeans.com

游客
2024-07-09 00:07:13

楼主的头像能辟邪啊!http://qivv.tjjixi.com

游客
2024-07-09 00:38:10

吹牛的人越来越多了!https://www.ejy365.com/purchase/list

游客
2024-07-09 00:59:07

楼主人气很旺!http://c67kjr.china-spwj.com

游客
2024-07-09 01:14:02

大神好强大!http://a90t.mededu.cn

游客
2024-07-09 01:14:24

信楼主,考试不挂科!http://1gr9h2.mclmdxgpl.com

游客
2024-07-09 01:16:55

楼上的说的很多!http://t0the2.mededu.cn

游客
2024-07-09 01:45:48

支持一下,下面的保持队形!http://94e4m5.008jeans.com

游客
2024-07-09 01:47:33

这么经典的话只有楼主能想到!http://rl0g.china-spwj.com

游客
2024-07-09 02:19:36

楼主很有激情啊!http://www.hongshanhl.com

游客
2024-07-09 02:38:16

楼主的帖子越来越有深度了!http://d6n.china-spwj.com

游客
2024-07-09 03:39:38

楼主的头像是本人吗?http://ui0sy.008jeans.com

游客
2024-07-09 04:07:07

勤奋灌水,天天向上!http://p08uz.66mmjj.com

游客
2024-07-09 04:31:46

我对楼主的敬仰犹如滔滔江水绵延不绝!http://mobile.sdyjgjg.com

游客
2024-07-09 04:31:51

好无聊啊!http://www.hbchuangjian.com

游客
2024-07-09 06:03:35

楼主就是我的榜样哦http://lxp.tjjixi.com

游客
2024-07-09 07:21:32

论坛人气好旺!http://ixmh1.slt11.com/u/5.html

游客
2024-07-09 07:21:51

我就搞不明白了,看帖回帖能死人么,居然只有我这么认真的在回帖!http://q1y.499965.com

游客
2024-07-09 09:22:21

楼主人气很旺!http://www.ddman.net

游客
2024-07-09 09:50:41

刚分手,心情不好!http://m.zjchuzhou.com

游客
2024-07-09 09:56:04

太高深了,理解力不够用了!http://m.hbchuangjian.com

游客
2024-07-09 10:30:25

看了这么多帖子,第一次看到这么高质量内容!http://eymom.mclmdxgpl.com

游客
2024-07-09 10:31:43

不灌水就活不下去了啊!http://x8ixz.008jeans.com

游客
2024-07-09 10:56:00

突然觉得楼主说的很有道理,赞一个!http://il0o1.mclmdxgpl.com

游客
2024-07-09 11:41:57

写的太好啦,评论一个http://6tkx.mclmdxgpl.com

游客
2024-07-09 11:43:27

我默默的回帖,从不声张!http://wap.gdlasa.com

游客
2024-07-09 11:53:25

十分赞同楼主!http://www.fhbfz.com

游客
2024-07-09 12:19:26

管它三七二十一!http://yee31.008jeans.com

游客
2024-07-09 12:19:42

楼主的头像能辟邪啊!http://k6djox.mededu.cn

游客
2024-07-09 12:29:18

收藏了,很不错的内容!http://ehn.mclmdxgpl.com

游客
2024-07-09 13:29:45

楼主的头像能辟邪啊!http://rbad.ii-love.com

游客
2024-07-09 16:52:09

雷锋做好事不留名,都写在帖子里!http://c4n2e.wbilbeo.cn

游客
2024-07-09 19:44:12

楼主很有激情啊!http://www.sdhsbxg.com

游客
2024-07-09 19:54:01

不错的帖子,值得收藏!http://f45.dlxxcl.cn

游客
2024-07-09 20:12:12

谢谢楼主的分享!http://x553.lv218.com

游客
2024-07-09 20:19:16

支持一下!http://8fzps.dlxxcl.cn

游客
2024-07-09 20:36:25

怎么我回帖都没人理我呢?http://irrhr5.dlxxcl.cn

游客
2024-07-09 23:20:20

我对楼主的敬仰犹如滔滔江水绵延不绝!http://p7q7.lv218.com

游客
2024-07-10 01:34:38

网页的加载速度非常快,不会影响用户体验。http://thnq.ooocr.com

游客
2024-07-10 01:34:52

这篇文章真是让人受益匪浅!http://xe4ces.zghfwlw.com

游客
2024-07-10 03:06:47

关注一下!http://5sf9.tjdtyb.com

游客
2024-07-10 04:14:14

不是惊喜,是惊吓!http://w26gsg.yafx.cn

游客
2024-07-10 04:43:23

不灌水就活不下去了啊!http://vc97.tjdtyb.com

游客
2024-07-10 04:53:05

这么经典的话只有楼主能想到!http://ldl.tjdtyb.com

游客
2024-07-10 07:08:48

楼主今年多大了?http://hdjy.lv218.com

游客
2024-07-10 07:17:12

我裤子脱了,纸都准备好了,你就给我看这个?http://6lr.tjdtyb.com

游客
2024-07-10 08:18:47

今天是个特别的日子,值得纪念!http://98198o.ttqhw.net

游客
2024-07-10 09:32:08

好东西,赞一个!http://j06.ttqhw.net

游客
2024-07-10 09:34:22

管它三七二十一!http://8pkq.dlxxcl.cn

游客
2024-07-10 10:25:45

感觉不错!http://c7yq.xinxing-ningbo.com

游客
2024-07-10 10:27:09

看在楼主的面子上,认真回帖!http://xlqe.xinxing-ningbo.com

游客
2024-07-10 10:32:19

这么版块的帖子越来越有深度了!http://4t3.lv218.com

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。