徹底清理idea設定指令碼
PS: 本指令碼在IDEA 2020的版本試執行成功,如果有遺漏請在底下留言
function printDeleteIdeaExec(){
user_home=~
# 在 ~/Library/Logs/JetBrains 找idea的設定
log_dir=$user_home/Library/Logs/JetBrains
ls -1 $log_dir | awk '{ print "rm -rf \""pwd"/"$0"\""}' pwd=$log_dir | grep IntelliJIdea
# 在 ~/Library/Preferences 找idea的設定
pre_dir=$user_home/Library/Preferences
ls -1 $pre_dir | awk '{ print "rm -f \""pwd"/"$0"\""}' pwd=$pre_dir | grep jetbrains
# 在 ~/Library/Application Support/JetBrains 找idea的設定
sup_dir="$user_home/Library/Application Support/JetBrains"
ls -1 "$sup_dir" | awk '{ print "rm -rf \""pwd"/"$0"\""}' pwd="$sup_dir" | grep IntelliJIdea
# 在 ~/Library/Caches/JetBrains 找idea的設定
cache_dir="$user_home/Library/Caches/JetBrains"
ls -1 "$cache_dir" | awk '{ print "rm -rf \""pwd"/"$0"\""}' pwd="$cache_dir" | grep IntelliJIdea
# 刪除idea的工作空間
idea_dir="$user_home/.idea"
echo "rm -rf $idea_dir"
}
printDeleteIdeaExec