{"id":818,"date":"2026-11-20T09:37:58","date_gmt":"2026-11-20T01:37:58","guid":{"rendered":"http:\/\/www.novdim.com\/blog\/?p=818"},"modified":"2026-11-20T09:37:58","modified_gmt":"2026-11-20T01:37:58","slug":"how-to-make-a-file-executable-in-terminal-480e-6ba32a","status":"publish","type":"post","link":"http:\/\/www.novdim.com\/blog\/2026\/11\/20\/how-to-make-a-file-executable-in-terminal-480e-6ba32a\/","title":{"rendered":"How to make a file executable in Terminal?"},"content":{"rendered":"<p>Hey there, if you\u2019re here, chances are you\u2019ve ran into a problem where a script, binary, or tool you downloaded just won\u2019t budge in your Terminal\u2014like, 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 &quot;permission denied&quot; error. I get it, I\u2019m the co-founder of a small Terminal supply company\u2014yeah, that\u2019s 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\u2019s way simpler than it sounds. Let me walk you through exactly how to make a file executable in Terminal, no fluff, no jargon. <a href=\"https:\/\/www.lingchengelectric.com\/terminal\/\">Terminal<\/a><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.lingchengelectric.com\/uploads\/48003\/small\/zinc-plated-hex-flange-nut86f8f.jpg\"><\/p>\n<p>First, let\u2019s get one thing straight: executability in Terminal isn\u2019t just a setting you toggle like a light switch. It\u2019s a permission\u2014specifically, an execute permission\u2014and it\u2019s separate from read and write permissions, which you\u2019re probably familiar with from file properties. Every file on your system has three sets of permissions: for the file\u2019s owner (that\u2019s 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\u2019s missing? Boom, permission denied. That\u2019s the error you\u2019re seeing.<\/p>\n<p>Let\u2019s 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\u2019m gonna stick to the most common scenarios you\u2019ll run into, since our customers almost never need the super edge-case stuff.<\/p>\n<p>First up: Mac and Linux. This is where 90% of the folks we help land. The command you\u2019re gonna use here is chmod, which stands for \u201cchange mode\u201d\u2014it\u2019s the tool that modifies file permissions. Let\u2019s 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\u2019s in, right? Because Terminal doesn\u2019t know where your file lives unless you tell it. That\u2019s step one, and it\u2019s super easy: if your file is on Desktop, just type cd Desktop in Terminal and hit enter. If it\u2019s 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\u2014that auto-fills the path, no typos, no mess. Pro tip: we tell all our clients to use drag-and-drop for paths if they\u2019re new to Terminal\u2014way less chance of messing up slashes or spaces.<\/p>\n<p>Once you\u2019re 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\u2019ll use is chmod +x filename. Let\u2019s make that concrete: if your file is called backup.sh, you\u2019d 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\u2019t want random other people on your machine running a random script you downloaded, right? That\u2019s a security thing, and it\u2019s 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\u2019s usually overkill for most tools you download or make yourself.<\/p>\n<p>But wait, what if you get a \u201cpermission denied\u201d error when you try to run chmod itself? That\u2019s rare, but it happens if the file\u2019s parent folder is read-only, like the root system folder (don\u2019t mess with that unless you know what you\u2019re doing). In that case, you\u2019d 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\u2014we always tell our clients to only use that when absolutely necessary, since it gives you full access to the entire system.<\/p>\n<p>Let\u2019s 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\u2014on the left, you\u2019ll see a string like rwxr-xr-x. The third character (after the owner\u2019s read and write) is the x for execute. If that shows up, you did it. Now to run it, just type .\/filename\u2014That .\/ matters! It tells Terminal \u201clook in the current folder for this file,\u201d not some other folder in your PATH. A lot of new folks forget that .\/ and just type the filename, and they get \u201ccommand not found\u201d which is another super common error we help with.<\/p>\n<p>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 \u201cpermission denied\u201d problem on Windows Terminal too, especially if you\u2019re running bash via WSL (Windows Subsystem for Linux) or even PowerShell. Let\u2019s split this into two parts: WSL\/Linux-like terminals on Windows, and native PowerShell.<\/p>\n<p>If you\u2019re 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\u2019t 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\u2019s a quick fix, though\u2014just add noexec to the mount flags if needed, but most of the time chmod works fine.<\/p>\n<p>If you\u2019re on native PowerShell, that\u2019s where it\u2019s a little different. PowerShell has its own execution policy setting that blocks untrusted scripts by default, which is actually a security feature, but it\u2019ll hit you as \u201cexecution policy restricted\u201d instead of permission denied. If you\u2019re 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\u2014no need to change your system-wide policy permanently, which we always advise against. Once that\u2019s set, to make a PowerShell script executable, you don\u2019t even need a chmod command\u2014PowerShell 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).<\/p>\n<p>Wait, let\u2019s talk about common mistakes, because those are the things that trip up even experienced folks. First, typos in filenames or paths. I can\u2019t 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\u2019s why dragging and dropping paths is your best friend. Second, forgetting the .\/ when running the file. I see this all the time\u2014someone runs chmod +x mytool, then types mytool and gets \u201ccommand not found\u201d because Terminal is looking in its PATH folders, not the current one. Third, using the wrong chmod flag. Don\u2019t do chmod 777 unless you absolutely have to\u2014777 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.<\/p>\n<p>Another thing: if you\u2019re using a binary file, not a script, the process is exactly the same. The chmod +x command works for compiled binaries too\u2014so 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\u2019t have to mess with it. That\u2019s actually why I know this stuff so well\u2014we deal with this every single day with our clients.<\/p>\n<p>Wait, what about if the file won\u2019t execute even after you do all this? Let\u2019s troubleshoot a little. First, check if it\u2019s 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 \u201ccannot be opened because the developer cannot be verified\u201d error\u2014right click the file, open it with Terminal, or go to System Settings &gt; Privacy &amp; Security and allow it. On Windows, same idea: if SmartScreen blocks it, right click the file, click \u201cProperties,\u201d and check the \u201cUnblock\u201d box at the bottom of the General tab. That\u2019s a common fix we help folks with too.<\/p>\n<p>Now, I know a lot of you are here because you\u2019re 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\u2019t 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\u2019t get that permission denied error in the first place. If you\u2019re 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.<\/p>\n<p>Before I wrap up, let\u2019s recap the super simple step-by-step to make sure you have it all down:<\/p>\n<ol>\n<li>Navigate to the folder with your file using cd (use drag-and-drop for paths to avoid typos).<\/li>\n<li>Run chmod +x your-filename to add execute permission.<\/li>\n<li>Confirm with ls -l (Mac\/Linux) or ls (WSL) that the x permission is there.<\/li>\n<li>Run the file with .\/your-filename (Mac\/Linux\/WSL) or .\\your-filename (PowerShell).<\/li>\n<\/ol>\n<p><img decoding=\"async\" src=\"https:\/\/www.lingchengelectric.com\/uploads\/48003\/small\/brass-hexagon-socket-cap-screwsf106a.jpg\"><\/p>\n<p>That\u2019s it. No weird commands, no complicated settings, just four steps. And if this still isn\u2019t working, or you\u2019re 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.<\/p>\n<p><a href=\"https:\/\/www.lingchengelectric.com\/metering-junction-boxes\/\">Metering Junction Boxes<\/a> References:<br \/>\nThe Linux chmod man page<br \/>\nMac Terminal permissions guidelines<br \/>\nWindows PowerShell execution policy documentation<br \/>\nWSL file system permission mapping notesReferences:<br \/>\nThe Linux chmod man page<br \/>\nMac Terminal permissions guidelines<br \/>\nWindows PowerShell execution policy documentation<br \/>\nWSL file system permission mapping notes<\/p>\n<hr>\n<p><a href=\"https:\/\/www.lingchengelectric.com\/\">Hangzhou Lingcheng Technology Co., Ltd.<\/a><br \/>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.<br \/>Address: Room 1613, 16th Floor, Building 3, No. 99 Wangzhou Road, Liangzhu Street, Yuhang District, Hangzhou City, Zhejiang Province<br \/>E-mail: LCKJ0408@163.com<br \/>WebSite: <a href=\"https:\/\/www.lingchengelectric.com\/\">https:\/\/www.lingchengelectric.com\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey there, if you\u2019re here, chances are you\u2019ve ran into a problem where a script, binary, &hellip; <a title=\"How to make a file executable in Terminal?\" class=\"hm-read-more\" href=\"http:\/\/www.novdim.com\/blog\/2026\/11\/20\/how-to-make-a-file-executable-in-terminal-480e-6ba32a\/\"><span class=\"screen-reader-text\">How to make a file executable in Terminal?<\/span>Read more<\/a><\/p>\n","protected":false},"author":414,"featured_media":818,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[781],"class_list":["post-818","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-industry","tag-terminal-4185-6c713b"],"_links":{"self":[{"href":"http:\/\/www.novdim.com\/blog\/wp-json\/wp\/v2\/posts\/818","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.novdim.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.novdim.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.novdim.com\/blog\/wp-json\/wp\/v2\/users\/414"}],"replies":[{"embeddable":true,"href":"http:\/\/www.novdim.com\/blog\/wp-json\/wp\/v2\/comments?post=818"}],"version-history":[{"count":0,"href":"http:\/\/www.novdim.com\/blog\/wp-json\/wp\/v2\/posts\/818\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.novdim.com\/blog\/wp-json\/wp\/v2\/posts\/818"}],"wp:attachment":[{"href":"http:\/\/www.novdim.com\/blog\/wp-json\/wp\/v2\/media?parent=818"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.novdim.com\/blog\/wp-json\/wp\/v2\/categories?post=818"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.novdim.com\/blog\/wp-json\/wp\/v2\/tags?post=818"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}