1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Ubuntuでディスク容量を圧迫した時にすること

Last updated at Posted at 2024-04-08

大雑把に確認

  1. コマンドを実行 sudo ncdu
  2. エクスプローラで確認しながらdキーで削除
    image.png

容量を圧迫しているファイルを検索

下記の方法で現在ディレクトリ以下のファイルで一覧し、不要なファイルを個別に削除します

コマンド:

find . -type f -exec du -h {} + | sort -rh | head

出力:

8.3G	./フォルダ名1/ファイル名1.mp4
7.9G	./フォルダ名1/ファイル名2.mp4
7.4G	./フォルダ名1/ファイル名3.mp4
6.3G	./フォルダ名4/ファイル名.mp4
6.1G	./フォルダ名5/ファイル名.mp4
5.8G	./フォルダ名6/ファイル名.mp4
4.8G	./フォルダ名7/ファイル名.mp4
4.7G	./フォルダ名8/ファイル名.mp4
4.4G	./フォルダ名9/ファイル名.mp4

キャッシュなどの削除

# dockerキャッシュの削除
docker system prune -a -f
docker volume prune -f

# aptの使っていないパッケージの削除
sudo apt-get autoremove
sudo apt-get clean
sudo apt-get autoclean

# 一時ファイルの削除
sudo rm -rf /tmp/*
sudo rm -rf /var/cache/*
sudo rm -rf /var/lib/snapd/cache/*

#Journalログの削除
sudo journalctl --vacuum-time=2weeks
sudo journalctl --vacuum-size=100M

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?