Skip to content

Instantly share code, notes, and snippets.

@BrunoTorresF
Last active January 10, 2019 00:17
Show Gist options
  • Select an option

  • Save BrunoTorresF/faf41b071aab013ca680461d01a919fa to your computer and use it in GitHub Desktop.

Select an option

Save BrunoTorresF/faf41b071aab013ca680461d01a919fa to your computer and use it in GitHub Desktop.
shell script to delete all user files and folders, uninstall Spotify, and reset Unity settings (Ubuntu 16)
#!/bin/sh
# delete local user files and empty trash
find /home/$USER/* -maxdepth 1 \! \( -name Documents -o -name Pictures -o -name Music -o -name Downloads -o -name Desktop -o -name Videos -o -name Public -o -name '\.*' -o -name Templates -o -name Examples -o -name Public \) -exec sudo rm -rf '{}' \;
sudo rm -rf /home/$USER/Documents/* /home/$USER/Pictures/* /home/$USER/Music/* /home/$USER/Downloads/* /home/$USER/Desktop/* /home/$USER/Videos/* /home/$USER/Public/*
rm -rf ~/.local/share/Trash/*
# remove git config
git config --global --unset-all user.name
git config --global --unset-all user.email
# uninstall Spotify & remove config files
sudo apt-get remove spotify-client && rm -R ~/.config/spotify && sudo rm /etc/apt/sources.list.d/spotify.list
# reset Unity settings
dconf reset -f /org/compiz/ && setsid unity
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment