IT-OS-Admin-macOS

From wiki.samerhijazi.net
Jump to navigation Jump to search

Ref.

MacOs-Tools

Icons

  • ⇧ (Shift)
  • ⌃ (Control)
  • ⌥ (Option)
  • ⌘ (Command)

Top Terminal Keyboard shortcuts

Action Shortcut
Show hidden files ⌘ + ⇧ + .
New window ⌘ + N
New tab ⌘ + T
Move insertion point to the beginning ⌃ + A
Move insertion point to the end ⌃ + E
[ ] ⌥ + 5 / ⌥ + 6
{ } ⌥ + 8 / ⌥ + 9
~ ⌥ + N
\ ⇧ + ⌥ + 7
| ⌥ + 7
| ⌥ + 7
Force Quit ⌥ + ⌘ + Esc
Mark message as Read ⌘ + T
Move files ⌘ + ⌥ + V

Tools

diskutil list   >>> List the partitions of a disk
drutil list     >>> Lists all connected burning devices.
--------------------------------------------------------
diskutil list
diskutil unmountDisk /dev/disk4
sudo dd if=./Fedora-Workstation-Live-43-1.6.x86_64.iso of=/dev/rdisk4 bs=4m status=progress

Xcode

xcodebuild -version
xcode-select -p
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install

brew

HOMEBREW_NO_INSTALL_CLEANUP=false
HOMEBREW_NO_ENV_HINTS=true
############################################
brew list --versions openjdk@21
brew link --force --overwrite openjdk@21

Uninstall all brew

brew list | xargs brew uninstall --force
brew list --cask | xargs brew uninstall --cask --force

Settings-A

defaults read xxx.appName
defaults write xxx.appName Setting -bool ture/false
-----------------------------------------------------------------------------------------------
defaults write com.apple.Finder _FXSortFoldersFirst -bool true
defaults write com.apple.Finder AppleShowAllFiles true
defaults write com.apple.Finder PlayUserInterfaceSoundEffects -bool false
-----------------------------------------------------------------------------------------------
defaults write com.apple.Terminal NSRequiresAquaSystemAppearance -bool no
defaults write com.apple.Terminal NSRequiresAquaSystemAppearance -bool no
-----------------------------------------------------------------------------------------------
defaults write com.apple.TextEdit NSRequiresAquaSystemAppearance -bool no
defaults write com.apple.TextEdit NSShowAppCentricOpenPanelInsteadOfUntitledFile -bool false
-----------------------------------------------------------------------------------------------
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool TRUE
-----------------------------------------------------------------------------------------------
defaults write com.apple.Dock
defaults write com.apple.dock "orientation" -string "bottom" && killall Dock
-----------------------------------------------------------------------------------------------
defaults write -g NSRequiresAquaSystemAppearance -bool Yes
defaults write -g NSRequiresAquaSystemAppearance -bool No
-----------------------------------------------------------------------------------------------
sudo spctl –master-disable       ### open from the unidentified developer 
osascript -e 'id of app "Terminal"'
-----------------------------------------------------------------------------------------------
killall Finder

Setting-B

sudo xattr -d com.apple.quarantine ./FileName.dmg

SecureDrive

hdiutil create -encryption AES-256 -size 500m -fs exFAT -volname "SecureDrive" ~/SecureDrive.dmg
hdiutil create -encryption AES-256 -size 500m -fs APFS -volname "SecureDrive" ~/SecureDrive.dmg
hdiutil create -type SPARSEBUNDLE -encryption AES-256 -size 500m -fs APFS -volname "SecureDrive" ./SecureDrive.sparsebundle
------------------------------------------
hdiutil attach ./SecureDrive.dmg
hdiutil detach /Volumes/SecureDrive
hdiutil detach /Volumes/SecureDrive -force