macOS

macOS Cheatsheet #

macOS is a Unix-based operating system developed by Apple Inc. It powers all Mac computers and is known for its sleek interface, robust performance, and advanced features. Below is a comprehensive cheatsheet to help you get started with macOS, covering various commands and their descriptions.

Cheatsheet #

System Information and Management #

CommandDescription
uname -aDisplay all system information
system_profilerDisplay detailed system information
dmesgShow system boot messages
topDisplay real-time system information
ps auxList all running processes
brew listList installed Homebrew packages
brew install <package>Install a Homebrew package
brew uninstall <package>Remove a Homebrew package
sudo <command>Run a command with superuser privileges

User and Group Management #

CommandDescription
dscl . -create /Users/<username>Add a new user
dscl . -delete /Users/<username>Delete a user
dscl . -append /Groups/<group> GroupMembership <username>Add a user to a group
dseditgroup -o create <group>Create a new group
dseditgroup -o delete <group>Delete a group
passwd <username>Change a user’s password

Network Management #

CommandDescription
ifconfigDisplay or configure network interfaces
ping <hostname/IP>Send ICMP ECHO_REQUEST to network hosts
netstat -nrDisplay the routing table
route -n add <destination> <gateway>Add a static route
networksetup -listallnetworkservicesList all network services
networksetup -setmanual <service> <IP> <subnet> <router>Configure a network interface manually
networksetup -setdnsservers <service> <DNS server>Set DNS servers for a network service

Disk Management #

CommandDescription
df -hDisplay disk usage in a human-readable format
du -sh <directory>Show disk usage of a directory
diskutil listList all disks and partitions
diskutil mount <device>Mount a filesystem
diskutil unmount <device>Unmount a filesystem
diskutil eraseDisk <format> <name> <device>Erase and format a disk

System Services and Daemons #

CommandDescription
sudo launchctl load /Library/LaunchDaemons/<service>.plistLoad a service
sudo launchctl unload /Library/LaunchDaemons/<service>.plistUnload a service
sudo launchctl start <service>Start a service
sudo launchctl stop <service>Stop a service
sudo launchctl listList all loaded services
`sudo launchctl listgrep `

File Operations #

CommandDescription
cp <source> <destination>Copy files or directories
mv <source> <destination>Move or rename files or directories
rm <file>Delete a file
rm -r <directory>Delete a directory and its contents
chmod <permissions> <file>Change file permissions
chown <owner>:<group> <file>Change file owner and group
ln -s <target> <link>Create a symbolic link

macOS

Explore our comprehensive cheatsheets to enhance your knowledge and efficiency. Each cheatsheet provides detailed command options, examples, and descriptions to help you master various tools and technologies.