Repository navigation
Expand file tree
/
Copy pathRemove
More file actions
26 lines (10 loc) · 1.62 KB
/
Copy pathRemove
File metadata and controls
26 lines (10 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
osascript -e 'tell application "Finder" to delete every item of folder (POSIX file "/users/computer/library")'
---------------------------------------------------------------------------------------------------------------------
for d in /Users/computer/Library/*; do [ -d "$d" ] && find "$d" -mindepth 1 -maxdepth 1 -exec osascript -e 'tell application "Finder" to move POSIX file "{}" to trash' \; 2>/dev/null; done
---------------------------------------------------------------------------------------------------------------------
/private/var/folders/zn/0wvkx_gs1xv_ffwbr_xjnchh0000gn/T
/private/var/folders/zn/0wvkx_gs1xv_ffwbr_xjnchh0000gn/C
/private/var/db
---------------------------------------------------------------------------------------------------------------------
chsh -s /bin/zsh
top -l 1 -o threads -stats pid,threads,command | awk 'NR>1 {pid=$1; threads=$2; $1=""; $2=""; sub(/^[ \t]+/, ""); print pid, threads, $0}' | while read -r pid threads command; do [[ "$pid" =~ ^[0-9]+$ ]] || continue; if [ "$pid" -eq 0 ]; then echo -e "\n----------------------------------------\n[PROTECTED] Process: [PID: 0] [Threads: $threads] [Command: $command] - Skipping kernel_task."; continue; fi; echo -e "\n----------------------------------------\nProcess: [PID: $pid] [Threads: $threads] [Command: $command]"; read -r -p "Do you want to run kill -9 on PID $pid? (y/n): " reply < /dev/tty; if [[ "$reply" == "y" || "$reply" == "Y" ]]; then echo "Executing: sudo kill -9 $pid"; sudo kill -9 "$pid" && echo "Result: Successfully terminated PID $pid" || echo "Result: Failed to terminate PID $pid"; else echo "Skipped."; fi; done