```bash
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"
}
```
网友评论