• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

techtips

Technical stuff!

  • Home
  • WindowsOS
  • Offline Installer
  • Web links

Create an executable command file in MAC OS

October 10, 2018 by admin Leave a Comment

In this post, we will see how we can create a MAC commands executable / batch file consisting of commands to run (an alternate to .bat file of windowsOS in MacOC)

If you have worked on windows command prompt, you might used .bat or batch file which will have all the commands that you want to run, and when you double click on the .bat file, commands will be executed one by one.

In MacOS you can create a new file with file extension / format as .command and enter all the commands you want to run as you run manually on MAC terminal.

 

Steps

  • Create a new file, Spotlight | TextEdit or any kind of text editor
  • Enter the commands to run from executable file, for example we will execute below command

echo Running terminal commands from an executable file
cd Desktop
ls

  • now save the file (Command + s) and name is as Test.command
  • Double click the file that you just saved to execute

 

Troubleshooting

Sometimes when you double click on the file, you might get some error while executing, so you can give access of “ownership” and set the “execute” on the file

Open the terminal and enter below command for the file to run,

chmod u+x /path/to/.command/file

Now double click on the .command file, you will see the out put on a terminal with out any error 🙂

Hope this helps!

 

Filed Under: MacOS

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Categories

Recents

  • Copy file path with slashes in MacOS Mojave instead of triangle
  • Open hidden files in mac text editor
  • How to manage and open chrome browser extensions or plugins
  • Create an executable command file in MAC OS
  • Backup windows environmental variables

Menu

open all | close all
  • Contact Us
    • About Us
  • Download [official] portable notepad++
    • Find IP address on windows machine
      • Different ways to open remote desktop from windows
      • How to restart remote machine/server in windows
      • Place chrome’s address bar to bottom of screen

Footer

Design

With an emphasis on typography, white space, and mobile-optimized design, your website will look absolutely breathtaking.

Learn more about design.

Content

Our team will teach you the art of writing audience-focused content that will help you achieve the success you truly deserve.

Learn more about content.

Copyright © 2025 · Genesis Sample on Genesis Framework · WordPress · Log in