macOS Guide

macOS Guide

This guide provides useful commands and tips for macOS users to enhance their productivity and system management.

Contents

Show Hidden Files

By default, macOS hides certain system files. To toggle the visibility of hidden files in Finder:

  1. Open Finder.
  2. Press Command + Shift + . (dot) to show or hide hidden files.

Terminal Commands

The Terminal app in macOS provides a command-line interface for advanced operations.

Basic Commands

# Navigate directories
cd /path/to/directory       # Change directory
ls                          # List files and directories
ls -la                      # List all files, including hidden ones
 
# File operations
touch file.txt              # Create an empty file
mkdir new_folder            # Create a new directory
rm file.txt                 # Delete a file
rm -rf folder               # Delete a directory and its contents
 
# System information
system_profiler SPHardwareDataType  # Detailed hardware info
sw_vers                        # macOS version

Managing Applications

Install Applications

  • App Store: Use the App Store to find and install applications.
  • Homebrew: A package manager for macOS to install software via the command line.
# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
 
# Use Homebrew to install applications
brew install wget            # Example: Install wget
brew install --cask firefox  # Example: Install Firefox

Uninstall Applications

  • Drag to Trash: Drag the application from the Applications folder to the Trash.
  • Homebrew: Use Homebrew to uninstall applications installed via Homebrew.
# Uninstall using Homebrew
brew uninstall wget          # Uninstall wget
brew uninstall --cask firefox # Uninstall Firefox

System Preferences

Keyboard Shortcuts

  • Customize Shortcuts: Go to System Preferences > Keyboard > Shortcuts to customize keyboard shortcuts.
  • Common Shortcuts:
    • Command + Space: Open Spotlight search
    • Command + Tab: Switch between open applications
    • Command + Option + Esc: Force quit applications

Network Management

Wi-Fi and Network Settings

  • View Network Information:

    ifconfig                    # Display network interfaces
    networksetup -getinfo Wi-Fi # Get Wi-Fi network information
  • Manage Network Locations:

    • Go to System Preferences > Network
    • Use the Location dropdown to manage network settings for different environments

Security and Privacy

Enable Firewall

  • System Preferences: Go to System Preferences > Security & Privacy > Firewall to enable and configure the firewall.

Gatekeeper

  • Manage App Permissions: Control which apps are allowed to run on your Mac.
    sudo spctl --master-disable  # Disable Gatekeeper (not recommended)
    sudo spctl --master-enable   # Enable Gatekeeper

Additional Resources