How to Screenshot on Mac: A Comprehensive Guide
Learn how to screenshot on Mac with shortcuts for the full screen, an area, or a window, plus the Screenshot app, clipboard, editing, and save-location tips.
To run a shell script on macOS, open Terminal, go to the folder containing the .sh file, and run it with its interpreter. For example, bash hello.sh runs a Bash script without changing its permissions. If you want to launch it as a command, make it executable with chmod +x hello.sh, then run ./hello.sh. These methods work on current macOS releases.
A shell script is a plain-text file containing commands. Those commands run with the permissions of your user account, so a script can edit or delete files, install software, or send data over a network. Read a script you received before running it, especially if it asks for an administrator password or uses sudo. Only run scripts from sources you trust; changing a file’s permissions does not make its contents safe.
Apple describes shell scripts as text files that contain UNIX commands and explains how a shebang selects the shell that runs the script. See Apple’s Terminal guide to shell scripts.
This is the simplest way to run a Bash script. You do not need to add execute permission first.
#!/bin/bash
echo "Hello from macOS"
Save the file as hello.sh. In the save dialog, check that the name ends in .sh and that TextEdit has not added .txt. The first line is the shebang: it identifies Bash as the interpreter when the script is launched directly. The second line prints a short message.

cd ~/Downloads
Press Return after each command. You can type ls to list files and confirm that hello.sh is there. Change Downloads to the folder you actually used. If a folder or file name contains spaces, put the path in quotation marks, such as cd "$HOME/My Scripts".

bash:bash hello.sh
Terminal should display Hello from macOS. If the script uses Zsh syntax instead of Bash, run zsh hello.sh. The shell that opens interactively in Terminal is usually Zsh, but that does not mean every script should be run with Zsh; use the interpreter the script was written for. A script’s shebang often indicates that interpreter.
You can also launch a script directly by its path. This is useful when you want to run it like a small command. Apple’s Terminal instructions for making a file executable use chmod for this step.
chmod +x hello.sh
This adds execute permission to this file. It is a one-time change unless permissions are later reset. Avoid using broader permission settings than needed; chmod +x is sufficient for a personal script you own.

./hello.sh
The ./ tells the shell to run the file in the current directory. Without it, the shell generally searches folders listed in PATH rather than the current folder. If you are elsewhere, either use cd to return to the script’s folder or enter its full path, for example ~/Downloads/hello.sh.

./hello.sh: confirm the filename, then run chmod +x hello.sh. Or use bash hello.sh if it is a Bash script and you do not need direct execution.pwd, list its contents with ls, and check the spelling and capitalization. Make sure the file is not actually named hello.sh.txt.PATH. Check the script’s documentation before installing anything.^M: the first line may point to an unavailable interpreter, or the file may use Windows-style line endings. Check the shebang and save the file with Unix (LF) line endings.Use bash hello.sh for a quick run when you know it is a Bash script. Use chmod +x hello.sh followed by ./hello.sh when you want to launch it directly and let its shebang choose the interpreter. Neither method installs missing dependencies, fixes incompatible commands, or verifies whether the script is trustworthy.
Learn how to screenshot on Mac with shortcuts for the full screen, an area, or a window, plus the Screenshot app, clipboard, editing, and save-location tips.
Combine multiple images into a single PDF on macOS using Finder or Preview. Control page order, avoid cropping, and fix missing pages without extra software.
Learn how to show FPS on a Mac with Steam’s performance overlay or Apple’s Metal Performance HUD, plus fixes when the counter does not appear.
Use Option–Command–Esc to force quit an unresponsive Mac app, or close it from the Apple menu, Dock, Activity Monitor, or Terminal.
Set up Split View, resize or replace a pane, use Mission Control, and learn when desktop window tiling is a better fit on your Mac.
Learn how to remove EXIF data from photos on macOS, hide location in Photos, clean exported JPEG copies with ExifTool, and verify the result.
Sync two folders on a Mac with SyncTwoFolders, choose a one-way or two-way update, and preview changes before files are replaced or removed.
Back up a Tumblr blog on your Mac with Tumblr’s web export. Download and unpack the ZIP, keep its posts and media safe, and know what the archive leaves out.
Use Google Maps on your Mac in Safari or Chrome, find places and routes, switch map layers, and add a Safari web app to your Dock on macOS Sonoma 14 or later.
Compare five free WAV-to-MP3 converters for Windows and macOS, including online file limits, local batch tools, and practical export settings.