Hey there, if you’re here, chances are you’ve ran into a problem where a script, binary, or tool you downloaded just won’t budge in your Terminal—like, you double-clicked it on Mac or Windows, or downloaded it from a repo, and when you type ./mytool in the command line, you get that annoying "permission denied" error. I get it, I’m the co-founder of a small Terminal supply company—yeah, that’s a weird gig, but we make those pre-configured Terminal setups, custom shell scripts, and lightweight CLI tools for devs, sysadmins, and even folks who just hate clicking through 10 different app installers. Most of our clients hit this exact wall when they first start messing with custom tools, and honestly? It’s way simpler than it sounds. Let me walk you through exactly how to make a file executable in Terminal, no fluff, no jargon. Terminal

First, let’s get one thing straight: executability in Terminal isn’t just a setting you toggle like a light switch. It’s a permission—specifically, an execute permission—and it’s separate from read and write permissions, which you’re probably familiar with from file properties. Every file on your system has three sets of permissions: for the file’s owner (that’s you, if you downloaded or made it), for the group it belongs to, and for everyone else. Execute permission lets the system run the file as a program or script, while read lets you view it and write lets you edit it. If that permission’s missing? Boom, permission denied. That’s the error you’re seeing.
Let’s break this down by OS, because Terminal works a little different on Mac, Linux, and Windows (wait, Windows Terminal now is just as good as the other two, right? We sell a lot of Windows Terminal custom profiles too, so I know the drill there). I’m gonna stick to the most common scenarios you’ll run into, since our customers almost never need the super edge-case stuff.
First up: Mac and Linux. This is where 90% of the folks we help land. The command you’re gonna use here is chmod, which stands for “change mode”—it’s the tool that modifies file permissions. Let’s say you have a file called myscript.sh that you downloaded to your Desktop, or a binary like myapp that you cloned from GitHub. First, you need to navigate to the folder it’s in, right? Because Terminal doesn’t know where your file lives unless you tell it. That’s step one, and it’s super easy: if your file is on Desktop, just type cd Desktop in Terminal and hit enter. If it’s in a subfolder, like Documents/DevTools, you can type cd Documents/DevTools or even drag and drop the folder from your file explorer into Terminal—that auto-fills the path, no typos, no mess. Pro tip: we tell all our clients to use drag-and-drop for paths if they’re new to Terminal—way less chance of messing up slashes or spaces.
Once you’re in the right folder, check if the file is there by typing ls and hitting enter. That lists all files in the current folder, so you can confirm the name is right. Now, to make it executable, the basic chmod command you’ll use is chmod +x filename. Let’s make that concrete: if your file is called backup.sh, you’d type chmod +x backup.sh and enter. That +x flag is what adds the execute permission for the owner, which is almost always what you want here. Wait, why just the owner? Because you don’t want random other people on your machine running a random script you downloaded, right? That’s a security thing, and it’s the default we recommend for almost every use case. If you wanted to give execute permission to everyone (not just you), you could do chmod a+x filename, but that’s usually overkill for most tools you download or make yourself.
But wait, what if you get a “permission denied” error when you try to run chmod itself? That’s rare, but it happens if the file’s parent folder is read-only, like the root system folder (don’t mess with that unless you know what you’re doing). In that case, you’d add sudo before chmod, so sudo chmod +x filename. That prompts you for your admin password, and lets you modify permissions even on restricted folders. Just be careful with sudo—we always tell our clients to only use that when absolutely necessary, since it gives you full access to the entire system.
Let’s test this out, right? After running chmod +x, you can confirm the permission changed by typing ls -l. That long listing shows all permissions for each file. Look for the line that has your filename—on the left, you’ll see a string like rwxr-xr-x. The third character (after the owner’s read and write) is the x for execute. If that shows up, you did it. Now to run it, just type ./filename—That ./ matters! It tells Terminal “look in the current folder for this file,” not some other folder in your PATH. A lot of new folks forget that ./ and just type the filename, and they get “command not found” which is another super common error we help with.
Now, Windows Terminal. Yeah, I know, Windows is a different beast because by default, executables have .exe, .bat, .cmd, etc. extensions, but you still run into this “permission denied” problem on Windows Terminal too, especially if you’re running bash via WSL (Windows Subsystem for Linux) or even PowerShell. Let’s split this into two parts: WSL/Linux-like terminals on Windows, and native PowerShell.
If you’re using WSL (which most devs are now, and we sell a ton of WSL Terminal integrations for Windows), the process is almost identical to Mac and Linux. Navigate to the folder with cd, use chmod +x, check with ls -l, run with ./filename. The only difference is Windows file permissions don’t always map perfectly to Linux ones, so sometimes you might need to adjust the mount options for your Windows drives (like /mnt/c/Users/YourName/Desktop) to get execute permissions. That’s a quick fix, though—just add noexec to the mount flags if needed, but most of the time chmod works fine.
If you’re on native PowerShell, that’s where it’s a little different. PowerShell has its own execution policy setting that blocks untrusted scripts by default, which is actually a security feature, but it’ll hit you as “execution policy restricted” instead of permission denied. If you’re running a script you wrote yourself or a trusted tool, you can temporarily lift the policy for the current session by typing Set-ExecutionPolicy RemoteSigned -Scope Process. That lets you run local scripts you made, and remote scripts you signed—no need to change your system-wide policy permanently, which we always advise against. Once that’s set, to make a PowerShell script executable, you don’t even need a chmod command—PowerShell treats scripts as executable if you have the right execution policy, and you run them with .\filename.ps1 (again, that .\ is key, just like ./ on Mac/Linux).
Wait, let’s talk about common mistakes, because those are the things that trip up even experienced folks. First, typos in filenames or paths. I can’t tell you how many times a client typed myscript.sh instead of MyScript.sh, or typed cd Desktop when the folder was Desktop\ (with a backslash, which is wrong for Mac/Linux). That’s why dragging and dropping paths is your best friend. Second, forgetting the ./ when running the file. I see this all the time—someone runs chmod +x mytool, then types mytool and gets “command not found” because Terminal is looking in its PATH folders, not the current one. Third, using the wrong chmod flag. Don’t do chmod 777 unless you absolutely have to—777 gives read, write, execute permissions to everyone, which is a huge security risk. Most of the time, chmod 755 is a safe middle ground if you want to make it accessible to others, but +x is simpler for personal use.
Another thing: if you’re using a binary file, not a script, the process is exactly the same. The chmod +x command works for compiled binaries too—so if you download a Rust or Go app, a custom binary from a repo, even a Node.js compiled tool, just cd to its folder, run chmod +x, and go. We get a lot of dev clients who download custom CLI tools for their work, and they all go through this exact step. And since we make custom Terminal setups for teams, we even pre-configure a lot of these permissions for their internal tools, so they don’t have to mess with it. That’s actually why I know this stuff so well—we deal with this every single day with our clients.
Wait, what about if the file won’t execute even after you do all this? Let’s troubleshoot a little. First, check if it’s actually a valid file. If you downloaded it from a random site, it might be a corrupted download, or it might not be the right type. On Mac, you might get a “cannot be opened because the developer cannot be verified” error—right click the file, open it with Terminal, or go to System Settings > Privacy & Security and allow it. On Windows, same idea: if SmartScreen blocks it, right click the file, click “Properties,” and check the “Unblock” box at the bottom of the General tab. That’s a common fix we help folks with too.
Now, I know a lot of you are here because you’re tired of fumbling with Terminal permissions, right? Our company specializes in building custom Terminal environments, pre-configured tools, and managed permission setups so you don’t have to go through this every time. We work with dev teams, sysadmins, and even small businesses that use Terminal for their workflow, and we handle everything from custom shell scripts to pre-built executable CLI tools, all with properly set permissions so you don’t get that permission denied error in the first place. If you’re interested in ditching the hassle of manual chmod commands and custom permissions, reach out to our team to talk about a custom Terminal setup that fits your needs.
Before I wrap up, let’s recap the super simple step-by-step to make sure you have it all down:
- Navigate to the folder with your file using cd (use drag-and-drop for paths to avoid typos).
- Run chmod +x your-filename to add execute permission.
- Confirm with ls -l (Mac/Linux) or ls (WSL) that the x permission is there.
- Run the file with ./your-filename (Mac/Linux/WSL) or .\your-filename (PowerShell).

That’s it. No weird commands, no complicated settings, just four steps. And if this still isn’t working, or you’re tired of dealing with Terminal permissions for your team or tools, feel free to connect with our team to discuss tailored Terminal solutions that streamline your workflow.
Metering Junction Boxes References:
The Linux chmod man page
Mac Terminal permissions guidelines
Windows PowerShell execution policy documentation
WSL file system permission mapping notesReferences:
The Linux chmod man page
Mac Terminal permissions guidelines
Windows PowerShell execution policy documentation
WSL file system permission mapping notes
Hangzhou Lingcheng Technology Co., Ltd.
We are one of the most professional terminal manufacturers and suppliers in China. With a professional production team, we are able to meet the needs of the majority of our customers. Please feel free to wholesale bulk high quality terminal from our factory. Customized orders are welcome.
Address: Room 1613, 16th Floor, Building 3, No. 99 Wangzhou Road, Liangzhu Street, Yuhang District, Hangzhou City, Zhejiang Province
E-mail: LCKJ0408@163.com
WebSite: https://www.lingchengelectric.com/