Last active
July 3, 2024 02:04
-
-
Save yuya-maemichi-synspective/51bc4c8af4d737307c169b721e8d308c to your computer and use it in GitHub Desktop.
macOS snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xmlstarlet ed --inplace -u '//module/@type' -v 'EMPTY_MODULE' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find ~ \ | |
-path "$HOME/.Trash" -prune -or \ | |
-path "$HOME/Library" -prune -or \ | |
-path '*/node_modules' -prune -or \ | |
-path '*/.idea/*.iml' -type f -print |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find ~ \ | |
-path "$HOME/.Trash" -prune -or \ | |
-path "$HOME/Google Drive" -prune -or \ | |
-path "$HOME/Library" -prune -or \ | |
-path '*/node_modules' -prune -or \ | |
-path '*/.idea/*.iml' -type f \ | |
-exec xmlstarlet sel -t -m 'module' -v '@type' -n '{}' \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat '/System/Applications/System Settings.app/Contents/Resources/Sidebar.plist' | | |
xmlstarlet sel -T -t -v '//array/dict/array/string' -n | | |
awk '{print "x-apple.systempreferences:" $0}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat '/System/Applications/System Settings.app/Contents/Resources/Sidebar.plist' | | |
xpath -p 'x-apple.systempreferences:' -e '//array/dict/array/string/text()' 2>/dev/null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open 'x-apple.systempreferences:com.apple.Displays-Settings.extension?arrangementSection' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x-apple.systempreferences:com.apple.Displays-Settings.extension?arrangementSection | |
x-apple.systempreferences:com.apple.preferences.softwareupdate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ref. https://xmlstar.sourceforge.net/docs.php
ref. https://xmlstarlet.readthedocs.io/en/latest/usage.html#xmlstarlet-edit