Benutzer-Werkzeuge

Webseiten-Werkzeuge


commands-macos

Sammlung nützlicher Befehle

macOS Specific Commands

list files including display of ACLs

ls -le

list files including display of extended attributes

ls -l@

clear ACLs of a file/directory

chmod -N some_file_name.dat

man chmod

clear extended attributes of a file/directory

xattr -c some_file_name.dat

man xattr

scrollable view of current network connections

nettop
## only non-loopback without name resolution
nettop -t external -n

man nettop

list TCP listen sockets

netstat -an -ptcp | grep LISTEN

man netstat

list TCP established sockets

netstat -an -ptcp | grep ESTABLISHED

man netstat

list UDP sockets

netstat -n -pudp

man netstat

clear DNS cache

sudo killall -HUP mDNSResponder

show DHCP/DHCPv6 client information for an interface

ipconfig getpacket en0
ipconfig getv6packet en0

man ipconfig

show system information

system_profiler | less

man system_profiler

show CPU information

sysctl machdep.cpu

man sysctl

check code signature / check whether app is allowed to run

## verify code signature of an app bundle (including embedded frameworks/libraries)
codesign --verify --verbose --deep /Applications/appToCheck.app
## check if Gate Keeper would allow execution of an app
spctl --verbose --assess --type execute /Applications/appToCheck.app
## check whether an app was notarized by Apple (required as of macOS 10.15)
codesign --test-requirement="=notarized" --verify --verbose /Applications/appToCheck.app

man codesign man spctl

show details for object/executable/library files

### show linked shared libraries
otool -L example.so
### show load commands (like min OS version)
otool -l examble.so

man otool

human readable printout of a plist file

plutil -p some.plist

man plutil

deal with OS updates

## query update servers and list available updates
softwareupdate -l
## install all available updates
softwareupdate -i -a

man softwareupdate

add draggable spacers to the Dock

defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'; killall Dock
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="small-spacer-tile";}'; killall Dock

check the recovery key of FileVault disk encryption

fdesetup status
sudo fdesetup validaterecovery
## you would probably want to do that after you completed
## setting up your new Mac and reassure yourself that the
## master key you've written down is correct

list loaded kernel extensions

kextstat

show status of Time Machine

tmutil status

don‘t put .DS_Store files on network filesystems

defaults write com.apple.desktopservices DSDontWriteNetworkStores true
Cookies helfen bei der Bereitstellung von Inhalten. Durch die Nutzung dieser Seiten erklären Sie sich damit einverstanden, dass Cookies auf Ihrem Rechner gespeichert werden. Weitere Information
commands-macos.txt · Zuletzt geändert: 2020/04/27 15:45 von alex