-
Notifications
You must be signed in to change notification settings - Fork 0
/
hidden-files.sh
executable file
·65 lines (61 loc) · 2.19 KB
/
hidden-files.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
#
# Reveal hidden files
[[ $EUID != 0 ]] && echo "* WARNING: For accurate output, run $0 as uid 0"
dirs="/var /tmp /etc /usr /lib /lib64 /boot /dev/shm /dev/mqueue /Library"
matched=0
for dir in ${dirs}; do
if [[ -e "${dir}" ]]; then
sudo find "${dir}/" -maxdepth 2 -name ".*" \
\! -name ".*.hmac" \
\! -name ".bash_profile" \
\! -name ".build-id" \
\! -name ".com.google.Chrome.*" \
\! -name ".config" \
\! -name ".git" \
\! -name ".dwz" \
\! -name ".github" \
\! -name ".gitignore" \
\! -name ".resolv.conf.systemd-resolved.bak" \
\! -name ".ssh-host-keys-migration" \
\! -name .AppleCustomMac \
\! -name .AppleDiagnosticsSetupDone \
\! -name .AppleSetupDone \
\! -name .CFUserTextEncoding \
\! -name .DS_Store \
\! -name .GKRearmTimer \
\! -name .GlobalPreferences.plist \
\! -name .ICE-unix \
\! -name .LastGKReject \
\! -name .MASManifest \
\! -name .PKInstallSandboxManager \
\! -name .RunLanguageChooserToo \
\! -name .SystemPolicy-default \
\! -name .Test-unix \
\! -name .X11-unix \
\! -name .XIM-unix \
\! -name .bash_logout \
\! -name .bashrc \
\! -name .cleanup.user \
\! -name .configureLocalKDC \
\! -name .file \
\! -name .font-unix \
\! -name .keystone_install_lock \
\! -name .keystone_system_install_lock \
\! -name .localized \
\! -name .metadata_never_index \
\! -name .placeholder \
\! -name .profile \
\! -name .pwd.lock \
\! -name .sim_diagnosticd_socket \
\! -name .staging \
\! -name .updated \
\! -path "/Library//Keychains/.*" \
\! -path "/Library/Keychains/.*" \
\! -path "/var//root/.*" \
\! -path "/var/root/.*" \
\! -path /var/root \
-ls 2>/dev/null || matched=1
fi
done
exit "${matched}"