This bash script allows you to free up to 3GB of disk space in your home directory, by deleting the cache of several applications.
- Clone the project
git clone git@github.com:ricardoreves/42-free-up-space-disk.git
- Navigate to the project directory
cd 42-free-up-space-disk
- Set the script executable permission
chmod +x free_up_space_disk.sh
- Run the script
bash free_up_space_disk.sh
- Run the script every time you log in.
echo "bash ~/42-free-up-space-disk/free_up_space_disk.sh" >> ~/.zshrc
- Navigate to your home directory
cd ~
- Display the total disk usage size of the directory
du -cksh *
- Manually delete the files you deem unnecessary
rm -rf <path>
- Navigate to your goinfre
cd /goinfre/<login42>
NOTE: however you will have to work on the same machine
- Save the contents of your home in a USB key
- Create a
.reset
/.reset_library
file at the root of your home
# reset the home directory
touch ~/.reset
# reset the home library directory
touch ~/.reset_library
Logout
thenLogin
- Now your home is like the first day !
- osxdaily.com - Command Line Disk Usage Utilities: df and du