20
28

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

HDの容量確保をする、ゴミを削除する方法「mac, ubuntu」

Last updated at Posted at 2016-02-20

他にも削除できるものがあれば御連絡ください。

#GUIで作業する
管理ボタン押下で容量食ってるファイルを探せる。必要ないのは消しておく。

スクリーンショット 2018-06-12 15.44.34.png

#コマンドで容量の確認

df -h
sudo /usr/bin/du -g -x -d 5 / | awk '$1 >= 5{print}'
or
du -sh /Library/*| sort -nr

#容量の確認(ubuntu)

sudo du -sb ./* | sort -n | numfmt --to=iec --suffix=B --padding=5

#削除(ubuntu)
autoremove
http://qiita.com/inohiro/items/5d358c30eb7bacb37c7c

#削除(mac)

####いらないアプリを消す
https://freemacsoft.net/appcleaner/

####一時ファイル削除

/private/var/tmp

####homebrewのキャッシュクリア

brew cleanup

すごい。ずっとやってなかったので11GBも空いた。

...
Removing: /Users/miyamoto/Library/Logs/Homebrew/x264... (68B)
Removing: /Users/miyamoto/Library/Logs/Homebrew/xtensor... (68B)
Removing: /Users/miyamoto/Library/Logs/Homebrew/xvid... (68B)
Removing: /Users/miyamoto/Library/Logs/Homebrew/xz... (68B)
Removing: /Users/miyamoto/Library/Logs/Homebrew/zeromq... (68B)
==> This operation has freed approximately 11.4GB of disk space.

docker削除

dockerも容量を取りがち。

docker stop $(docker ps -q)
docker rm $(docker ps -q -a)
docker rmi $(docker images -q)

####macのキャッシュ削除

sudo rm -dfR /System/Library/Caches/* /Library/Caches/* ~/Library/Caches/*
or
sudo rm -rf /System/Library/Caches/* /Library/Caches/* ~/Library/Caches/*

Javaを消す

言語でいらないものがあれば消す。

/System/Library/Java/JavaVirtualMachines/
/Library/Java/JavaVirtualMachines/
/Users/$USER/Library/Java/JavaVirtualMachines

Adobeのキャッシュ削除

rm -rf ~/Library/Application\ Support

####ハイパネーション機能データ削除

sudo rm /private/var/vm/sleepimage

####iTunesの設定を変更して削減する方法
http://www.moreitfun.com/2015/04/04/how-to-delete-other-strage/

####iphone appのデータ削除
http://kotonova.com/1963

####xcodeデータ削除
http://qiita.com/hirayaCM/items/14dc021d4b27bdbfbb3d

~/Library/Developer/Xcode/Archives
~/Library/Developer/Xcode/DerivedData
~/Library/Developer/Xcode/iOS DeviceSupport/
~/Library/Application Support/iPhone Simulator
~/Library/Logs
~/Library/Developer/CoreSimulator/Devices

####docker

rm -rf ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2

####imovieデータ削除
http://tipstour.net/delete-imovie-temp-files

####その他
http://qiita.com/sea_mountain/items/b9a6af33bd50f0e344ef


macのメモリの解放

sudo purge

参考

20
28
1

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
20
28

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?